Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi All,
I have a test PBI file where I am encountering an issue I cant quite solve. I am calculating the p.p. difference between scores across two years and want to exclude any record for which there is no data for the most recent year (filtered).
The formula I am using is below, I need to exclude any record where there is no record for Year_New
Score p.p. YoY% =
IF(
ISFILTERED('TestData'[Year_New]),
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(
[Calc],
DATEADD('TestData'[Year_New].[Date], -1, YEAR)
)
RETURN
[Calc] - __PREV_YEAR
)pbix file link below
Solved! Go to Solution.
Hi @Anonymous
You may add IF conditon like below:
Score p.p. YoY% =
IF (
ISFILTERED ( 'TestData'[Year_New] ),
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 ( [Calc], DATEADD ( 'TestData'[Year_New].[Date], -1, YEAR ) )
RETURN
IF ( [Calc] <> BLANK (), [Calc] - __PREV_YEAR )
)
Regards,
Cherie
Hi @Anonymous
You may add IF conditon like below:
Score p.p. YoY% =
IF (
ISFILTERED ( 'TestData'[Year_New] ),
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 ( [Calc], DATEADD ( 'TestData'[Year_New].[Date], -1, YEAR ) )
RETURN
IF ( [Calc] <> BLANK (), [Calc] - __PREV_YEAR )
)
Regards,
Cherie
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 38 | |
| 36 | |
| 30 | |
| 28 |
| User | Count |
|---|---|
| 128 | |
| 88 | |
| 79 | |
| 67 | |
| 62 |