Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
markhay
Frequent Visitor

Volume query with measures (dividing filtered value by total value)

I'm attempting to complete some price volume mix analysis and have been given a set of calculations but I'm now stuck when trying to divide a measure which will be filtered by rows by the total value of the column. The values I'm using are measures and would be displayed in a matrix with Dates as columns and Item Types as rows.

 

The plain text calculation would be:

Quantity - ((QuantityLY/TotalQuantityLY) * TotalQuantity)

 

In the scenario of 1 type of item sales the values would be as below (in a step order)

31498 – ((34087/ 1254085) * 1229307)

31498- (0.0271807732330743 * 1229307)

31498 - 33,413.51480083087

-1,915.51480083087

 

Any sense checks would be appreciated. 

1 ACCEPTED SOLUTION
markhay
Frequent Visitor

Resolved - 

[QuantityM] - (([QuantityLY]/CALCULATE([QuantityLY],ALLSELECTED()))*CALCULATE([QuantityM],ALLSELECTED()))

View solution in original post

5 REPLIES 5
markhay
Frequent Visitor

Resolved - 

[QuantityM] - (([QuantityLY]/CALCULATE([QuantityLY],ALLSELECTED()))*CALCULATE([QuantityM],ALLSELECTED()))
DataNinja777
Super User
Super User

Hi @markhay 

 

I am curious why QuantityLY is being substituted by two different numbers in your example.  Do you mean, the first QuantityLY is QuantityCY instead?  

DataNinja777_0-1719314335774.png

Best regards,

 

Good spot - fat fingers. Should have read as: Quantity - ((QuantityLY/TotalQuantityLY) * TotalQuantity)

QuantityLY meaning quantity last year?

Yes - the middle part aims to work out the proportion of that items sales against all sales.

i.e. what % of sales quantity was attributed to that item last year and then multiplying by current year total volume would show what sale volumes would have been expected if proportions remained the same. 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.