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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sanimesa
Post Prodigy
Post Prodigy

DAX help for calculating revenue impact - MTD Average Price to Trailing 3 Months Average Price

I need to show the impact on price changes for each item, for instance current month average price to trailing 3 month average price. 

 

I created three measures, MTD Average Price, Trailing 3 Months Average Price and the MTD Quantity.

 

Then a measure for the Price impact;

 

Price Impact Trailing3 = SUMX(Reporting_JSG_ConsolidatedInvoices, [MTD Quantity]*([MTD Average Unit Price] - [Trailing3 Average Unit Price])) 

 

This is not showing the expected result - basically it is calculating the [Trailing3 Average Unit Price] as zero in this context. 

What is the correct way to create the desired measure? Any help appreciated. 

 

Sample data attached below:

https://1drv.ms/u/s!AqfAbaFIezosa2I2Ny9-JQCi4nM

 

MTD Average Unit Price:  $369.41 

MTD Quantity: 281

Trailing3 Average Unit Price: $536.92

Price Impact Trailing3: $573,133.88 (incorrect)

Expected Correct Result:    ($47,070.31)  (=MTD Quantity*(Trailing3 Average Unit Price - MTD Average Unit Price:)

 

Thanks.

2 REPLIES 2
mattbrice
Solution Sage
Solution Sage

Need to see model design and measures to help.  Or sample table data and desired output.  Not enough info provided to help.

@mattbrice  Hi Matt, Posted a sample file and added more explanation.

 

Thanks.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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