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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
bo_wang5
Helper II
Helper II

need help calculating yoy difference

I'm trying to not show the diff YOY actual for dates in the future, I tried a if statement but this does not apply to the totals so that it is still calculating across the row.  i'd like to sum just the difference to date.
 
diff YOY Acctual = if(isblank([Pipeline]),"",([Pipeline]-[Pipeline ly]))
 

bo_wang5_0-1628295548583.png

 

 

3 REPLIES 3
CNENFRNL
Community Champion
Community Champion

Rows from 2021 Sept are forced to shown because of [PIPELINE LY]; what's more, "" is also a non-blank value to show.

diff YOY Acctual =
VAR __p = [Pipeline] RETURN IF( NOT ISBLANK( __p ), ( __p - [Pipeline ly] ) )

 


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

I have solved the issue with a different method, however now I have a different problem,

 

I created some dummy data to work on the code,

 

diff YOY amount = SUMX(
SUMMARIZE('calendar','calendar'[Year],'calendar'[Month Name],"ABCD",
if(ISBLANK([revneue]),
BLANK(),
[revneue]-[revenue ly])),
[ABCD])

 

as you can see the YOY is calculated correctly now at the year month level, but it is not correct at the customer level.  I need a generic YOY difference measure that can calculate YOY difference in by any column.  

 

https://drive.google.com/file/d/11iIHWdMjnCOGJOmBBiIjFH2ljTKJ6vN3/view?usp=sharing

 

bo_wang5_1-1628355939656.png

 

 

i'm still showing the incorrec sum on that column, not sure why this is happining, it blanks the data correctly but it is still summing across ther row.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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