Using DAX Measures that calculate by row rather than a summary, in Microsoft Power BI

In this Video, I’ll create a DAX (Data Analysis eXpression) Measure.  This measure will be used to calculate the total sales price.  Check out this video to see how to create a measure that performs “Aggregation with Iteration”; which is a fancy way of saying DAX needs to calculate the total sales price for each row, then sum it together.  Look at the two examples below and you’ll see why.

 

Math

In this Video, I’ll create a DAX (Data Analysis eXpression) Measure.  This measure will be used to calculate the total sales price.  Check out this video to see how to create a measure that performs “Aggregation with Iteration”; which is a fancy way of saying DAX needs to calculate the total sales price for each row, then sum it together.  Look at the two examples below and you’ll see why.

Sold Quantity Per Item Price (Unit Price)
5 T-Shirts $5 per shirt
10 Stickers $1 per sticker

Which is correct to calculate the Total Sales?

15 (sum of the quantity of all items sold) * $6 (sum of Unit Price) = $90 Total Sales

OR

(5 T-Shirts * $5) + (10 Stickers * $1) = $35 Total Sales

DAX can be used in Microsoft Power BI, Microsoft PowerPivot, and MDX.  It’s a relatively easy way to model your data.

Today’s DAX Expression:

Extended Price := SUMX(‘Sales Line Items’, ‘Sales Line Items'[Qty] * ‘Sales Line Items'[Unit Price])

Author: Belinda Allen

Belinda Allen (Microsoft MVP) is both a Microsoft Certified Professional for Dynamics GP (MCP) and a Microsoft Certified Trainer (MCT). She is also the co-founder of Smith & Allen Consulting, Inc. (www.saci.com), a business management software consulting firm for over 24 years. Belinda began implementing ERP systems so long ago that Windows was not an operating system, but an application. Larger businesses used old Main Frames with monitors that were Green and Black and smaller business did accounting by hand. Having seen the evolution that has taken place over the years from pieces of paper to analytics, Belinda still gets excited every time she helps a business improve. Belinda is also well known for her Blog www.BelindaTheGPcsi.com. Her blog is about sharing really useful information about the product quickly and succinctly. She has earned the nickname GP CSI because she excels at reviewing GP problems and figuring what went wrong and why. With followers all over the Globe she is able to share knowledge and achieve her mission: “To Improve the Lives and Business Success of my Followers.” In her time off, Belinda enjoys sailing, woodturning, crochet/knitting, sewing/quilting, reading and playing the ukulele (Belinda often participates in Ukulele Jams in NYC.)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s