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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
fallingfirst
Frequent Visitor

Need help with price effect calculation

Hi, I tried using both calculated column and measure to calculate price impact but it is not returning my desired results.

My goal is to create a visualization with a slicer which would show price impact of product A & B, based on selected period.

Price impact is calcuted as (Price CY - Price PY) * Units CY.

If I create a calculated column, it will return total price impact of 430.

If I create a measure, it will return price impact of 408 (Calculation is done based on total YTD values of A & B)

The correct price impact should be 1,820 - 1,400 = 420. (Pricing impact on YTD values of A & B seperately, then added together)

Any advise wouldbe greatly appreciated

 

Data Model

MonthProductSales CYUnits CYPrice CYSales PYUnits PYPrice PYPrice Impact
1A500020025.0306018017.01,600
1B575025023.0552023024.0-250
2A462021022.0418019022.00
2B460020023.0450018025.0-400
3A575023025.0504021024.0230
3B575025023.0598023026.0-750
 Total314701340 282801220 430

 

Visualization with monthly slicer - selected months 1 to 3

 Sales CYUnits CYPrice CYSales PYUnits PYPrice PYPrice Impact
Product A1537064024.01228058021.21,820
Product B1610070023.01600064025.0-1,400
Total31470134023.528280122023.2408
1 ACCEPTED SOLUTION

Hi @fallingfirst ,

Thank you for your kind reply!

Could you please provide a screenshot of this if it is in excel?

3.png

Thanks for your understanding. Your time and cooperation are much valued by us. We are looking forward to hearing from you to assist further.

Best regards,

Lucy Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
fallingfirst
Frequent Visitor

Thank you all for your solutions! Unfortunately, the correct price impact should be 420 and not 430.

I guess what I need is a combination of both SUM and SUMX. The calculation should be done at the product level, but should be based on aggregated sales/units of defined period in month slicer.

This can be done in excel using calculated columns on a sliced pivot table, but I'm not sure how to replicate this in Power BI

 

Hi @fallingfirst ,

Thank you for your kind reply! Could you tell us why the result is 420 and share your logic with us?

Thanks for your understanding. Your time and cooperation are much valued by us. We are looking forward to hearing from you to assist further.

Best regards,

Lucy Chen

Hi Lucy,

Thank you for your prompt response.

We would get a price impact of 420 if the calculation is done based on YTD Sales/Unit values.

If we do the calculation based on MTD Sales/Unit values, and then added up the price impact of each month, this would return 430.

 Sales CYUnits CYPrice CYSales PYUnits PYPrice PYPrice Impact
Product A1537064024.01228058021.21,820
Product B1610070023.01600064025.0-1,400
Total314701340 28280122023.2420

Hi @fallingfirst ,

Thank you for your kind reply!

Could you please explain how the value of 1820 in the 'Price Impact' column was derived? According to the logic and the data you provided, the calculation for price impact should be (Price CY - Price PY) * Units CY. Therefore, the price impact for Product A should be 1600 + 0 + 230 = 1830?

Did you not provide us with the complete table data? You calculated separately for YTD and MTD, but your data table only contains monthly data and does not have more complete data regarding dates!

Could you pleaseshare your Excel spreadsheet or your sample data file with us. Thank you for your understanding!

How to provide sample data in the Power BI Forum - Microsoft Fabric Community

Best regards,

Lucy Chen

 

The below table shows price calculation performed on the monthly and YTD sales. I am only doing a simulation in excel as I am unable to share my company's data model.

 

Product ASalesCYUnitsCYPriceCYSalesPYUnitsPYPricePYPrice Impact
1500020025.00306018017.001,600
2462021022.00418019022.000
3575023025.00504021024.00230
YTD1537064024.021228058021.171,820

Hi @fallingfirst ,

Thank you for your kind reply!

Could you please provide a screenshot of this if it is in excel?

3.png

Thanks for your understanding. Your time and cooperation are much valued by us. We are looking forward to hearing from you to assist further.

Best regards,

Lucy Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-xinc-msft
Community Support
Community Support

Hi @fallingfirst ,

Please check.

1.png

We recommend you to use the code.

PriceImpact = SUMX('Table', ([Price CY] - 'Table'[Price PY]) * [Units CY])

Best regards,

Lucy Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

audreygerred
Super User
Super User

Hi! I created this measure and came out with 430 for the total: 

Measure = SUMX('Table',('Table'[Price CY]-'Table'[Price PY])*'Table'[Units CY])
What the SUMX does is allow the ('Table'[Price CY]-'Table'[Price PY])*'Table'[Units CY]) to be calculated at each row, then it adds all of those values together.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Solution Authors