Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Sign up nowGet Fabric certified for FREE! Don't miss your chance! Learn more
Hi,
I have created a measure to calculate this week compared to last week. But when this or last week is blank its calcuting 0 versus this or last weeks number. How can I get around this? I have tried using a IF(HASONE VALUE statement the below measure but returns "Blank" unconditionally
Solved! Go to Solution.
Hi,
Hope this helps:
Might have done an overkill on variables though 🙂
Difference Last week =
VAR
CrntWeek = WEEKNUM(TODAY())
VAR
CRNTVAL = CALCULATE(SUM('Table'[Value]); 'Table'[Week] = CrntWeek)
VAR
PrevVAL = CALCULATE(SUM('Table'[Value]); 'Table'[Week] = CrntWeek-1)
VAR
WeekDIFF = CRNTVAL - PrevVAL
RETURN
IF(CRNTVAL = BLANK() || PrevVAL = BLANK() ; BLANK() ; WeekDIFF)
Hi there,
Just to have an idea what your expected result is.
Are you creating a KPI card? a table ?
Hi Robbie
Sure, forgot that. Its a KPI card which now shows 7.7 as it is calculating difference between week 47 (7.7) and 46 (which doesnt have data). I want it to show BLANK if the week before (46) or the current week (47) is without value.
Hi,
Hope this helps:
Might have done an overkill on variables though 🙂
Difference Last week =
VAR
CrntWeek = WEEKNUM(TODAY())
VAR
CRNTVAL = CALCULATE(SUM('Table'[Value]); 'Table'[Week] = CrntWeek)
VAR
PrevVAL = CALCULATE(SUM('Table'[Value]); 'Table'[Week] = CrntWeek-1)
VAR
WeekDIFF = CRNTVAL - PrevVAL
RETURN
IF(CRNTVAL = BLANK() || PrevVAL = BLANK() ; BLANK() ; WeekDIFF)
Thanks Robbie!
It works perfectly!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 65 | |
| 65 | |
| 48 | |
| 21 | |
| 18 |
| User | Count |
|---|---|
| 119 | |
| 117 | |
| 38 | |
| 36 | |
| 27 |