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.
Hi all,
I am doing some year over year calculations and came across an issue I can't seem to solve. I am using the built in YoY quick measure. What's happening here is its trying to do the calculation for december 2021 because december 2020 exists, however there is no data for december 2021 (nor is there a date in the dataset for december 2021).
How do I get rid of this -100.00%?
Thanks!
Solved! Go to Solution.
Try checking for a blank sum:
VALUE YoY% =
IF (
ISFILTERED ( 'TABLE'[REF_YEAR] ),
ERROR ( "Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column." ),
VAR __PREV_YEAR =
CALCULATE (
SUM ( 'TABLE'[VALUE] ),
DATEADD ( 'TABLE'[REF_YEAR].[Date], -1, YEAR )
)
VAR __CURR_YEAR = SUM ( 'TABLE'[VALUE] )
RETURN
IF (
ISBLANK ( __CURR_YEAR ) || ISBLANK ( __PREV_YEAR ),
BLANK (),
DIVIDE ( __CURR_YEAR - __PREV_YEAR, __PREV_YEAR )
)
)
Try checking for a blank sum:
VALUE YoY% =
IF (
ISFILTERED ( 'TABLE'[REF_YEAR] ),
ERROR ( "Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column." ),
VAR __PREV_YEAR =
CALCULATE (
SUM ( 'TABLE'[VALUE] ),
DATEADD ( 'TABLE'[REF_YEAR].[Date], -1, YEAR )
)
VAR __CURR_YEAR = SUM ( 'TABLE'[VALUE] )
RETURN
IF (
ISBLANK ( __CURR_YEAR ) || ISBLANK ( __PREV_YEAR ),
BLANK (),
DIVIDE ( __CURR_YEAR - __PREV_YEAR, __PREV_YEAR )
)
)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
145 | |
111 | |
92 | |
84 | |
66 |