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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
jordanesqu
Frequent Visitor

VolPriceMix Calculation - how to multiply single rows by total/subtotal in the same table

Hi All,

I am trying to calculate price volume mix variance and having a trouble to find a way how to multiply the average value for wholeportfolio by values in a single rows.

I would like to multiply Delta Quantity for each product by average price per piece (yellow highlighted). I am aiming also the whole calculation work flexible as I have more dimensions like Region, Pack type, Customer etc.

 

Thank you for help.

 

PMV.JPG

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@jordanesqu , it can be

 

avg price per piece = calculate([price per piece], all(Table[product]))

or

avg price per piece = calculate([price per piece], all(Table))

 

new measure = [Delta Qty] * [avg price per piece]

 

also refer

https://community.powerbi.com/t5/Desktop/Percentage-of-subtotal/td-p/95390

https://www.sqlbi.com/articles/managing-all-functions-in-dax-all-allselected-allnoblankrow-allexcept...

https://www.sqlbi.com/articles/using-allexcept-versus-all-and-values/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@jordanesqu , it can be

 

avg price per piece = calculate([price per piece], all(Table[product]))

or

avg price per piece = calculate([price per piece], all(Table))

 

new measure = [Delta Qty] * [avg price per piece]

 

also refer

https://community.powerbi.com/t5/Desktop/Percentage-of-subtotal/td-p/95390

https://www.sqlbi.com/articles/managing-all-functions-in-dax-all-allselected-allnoblankrow-allexcept...

https://www.sqlbi.com/articles/using-allexcept-versus-all-and-values/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
dedelman_clng
Community Champion
Community Champion

Hi @jordanesqu  - 

 

Try something like this:

 

 

VolPriceMix =
VAR __AllProdAvg =
    CALCULATE (
        DIVIDE ( SUM ( Products[Price] ), SUM ( Products[QtyCY] ) ),
        ALLSELECTED ( Products )
    )
RETURN
    CALCULATE ( SUM ( Products[DeltaQ] ) * __AllProdAvg )

 

2020-08-28 08_54_16-scratch3 - Power BI Desktop.png

 

Hope this helps

David

 

@dedelman_clng  You can remove the last CALCULATE as it is not doing anything there 🙂

Anonymous
Not applicable

What does the model look like?

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.