Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hello,
The table on the left shows Crrrent year and Previous Year Data. THe table on the right shows the Variance between the two fiscal years. From Period 9 to 12 I have to Current Year Data. How can I make my varaince blank for those periods? I tried the DAX formula below but it does not work.
Variance2 =
VAR CY = [Current Year]
VAR PY = [Previous Year]
VAR VarianceT = CY-PY
VAR RESULT = IF (ISBLANK (CY),0,(VarianceT))
RETURN Result
Solved! Go to Solution.
Nevermind! I seem to have overcomplicated my DAX formulas. This fixes everything, and now my visual excludes periods which cannot be compared!
Current.YearT = [Amount]
Previous.YearT = (CALCULATE([Amount], SAMEPERIODLASTYEAR('Calendar'[Date])))
Variance2 = if(isblank([Current.YearT]),blank(),[Current.YearT]-[Previous.YearT])
Variance.T% = Divide([Variance2],[Current.YearT])
@Anonymous , Make 0 as blank and try
Variance2 =
VAR CY = [Current Year]
VAR PY = [Previous Year]
VAR VarianceT = CY-PY
RETURN IF (ISBLANK (CY),blank(),(VarianceT))
You can do this for PY measure too, if you want hide the rows. You have do it for all the measures
My Current Year and Previous Year are written this way.
Current Year = if(ISBLANK([Amount]),"$0",([Amount]))//Same as Amount
Previous Year = IF(ISBLANK(CALCULATE([Amount], SAMEPERIODLASTYEAR('Calendar'[Date]))),"$0",CALCULATE([Amount], SAMEPERIODLASTYEAR('Calendar'[Date])))
Nevermind! I seem to have overcomplicated my DAX formulas. This fixes everything, and now my visual excludes periods which cannot be compared!
Current.YearT = [Amount]
Previous.YearT = (CALCULATE([Amount], SAMEPERIODLASTYEAR('Calendar'[Date])))
Variance2 = if(isblank([Current.YearT]),blank(),[Current.YearT]-[Previous.YearT])
Variance.T% = Divide([Variance2],[Current.YearT])
Hi,
Since CY is a measure, it should be between []. So try this
=if(isblank([CY]),blank(),[CY]-[PY])
Hope this helps.
Unfortunately it di not work. My negative variances caused by No periods in 2020-2021 are still appearing
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.