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
ewu
Helper I
Helper I

Seemingly simple Excel task about Mth-to-Mth change, but really need DAX help

ewu_0-1678082193065.png

Really appreciate help - how do I go from the top 2 tables to get the results of the table at the bottom?

Basically it is just a month-to-month change in value, but ... DAX is hard...

Thanks a lot!

1 ACCEPTED SOLUTION
DAXDigger
Regular Visitor

Measure = 
VAR _currentRevenue = CALCULATE(SUM(Customer[Revenue]))
VAR _selectedDate = MAX(Customer[Month])
VAR _prevDate = CALCULATE(MAX(Customer[Month]),Customer[Month]< _selectedDate)
VAR _prevRevenue = CALCULATE(SUM(Customer[Revenue]),ALL(Customer[Month]),Customer[Month]=_prevDate)
RETURN IF(_prevRevenue = 0 ,1, (_currentRevenue - _prevRevenue)/_prevRevenue)

DAXDigger_0-1678088951685.png

 

View solution in original post

2 REPLIES 2
DAXDigger
Regular Visitor

Measure = 
VAR _currentRevenue = CALCULATE(SUM(Customer[Revenue]))
VAR _selectedDate = MAX(Customer[Month])
VAR _prevDate = CALCULATE(MAX(Customer[Month]),Customer[Month]< _selectedDate)
VAR _prevRevenue = CALCULATE(SUM(Customer[Revenue]),ALL(Customer[Month]),Customer[Month]=_prevDate)
RETURN IF(_prevRevenue = 0 ,1, (_currentRevenue - _prevRevenue)/_prevRevenue)

DAXDigger_0-1678088951685.png

 

Thanks so much!

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.