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
As marked by highlighter, Some null values are not showing 0. What should I do in that case?
I have attached the dax code with it.
Please give the solution.
Hi, @Anonymous
Thanks for rajendraongole1 reply. Have you currently resolved this issue, and if not, could you please share the pbix file without sensitive data to test.
Best Regards,
Yang
Community Support Team
Hi @Anonymous -I have modify the code slightly. The issue might arise from how LWK or CWK variables using the coalese function there to handle blanks.
Demand =
VAR _startdate = MAX('MDS Report'[MDS Date])
VAR LWK = CALCULATE(
SUM('MDS Report'[Quantity]),
'MDS Report'[WK] = "LWK",
'MDS Report'[Week] >= _startdate,
'MDS Report'[Week] <= _startdate + 91
)
VAR CWK = CALCULATE(
SUM('MDS Report'[Quantity]),
'MDS Report'[WK] = "CWK",
'MDS Report'[Week] >= _startdate,
'MDS Report'[Week] <= _startdate + 91
)
-- Ensure LWK and CWK return 0 if they are BLANK
VAR LWK_Valid = COALESCE(LWK, 0)
VAR CWK_Valid = COALESCE(CWK, 0)
VAR Change = SWITCH(
TRUE(),
LWK_Valid = CWK_Valid, 0,
LWK_Valid = 0 && CWK_Valid <> 0, 100,
CWK_Valid = 0 && LWK_Valid <> 0, -100,
LWK_Valid <> 0, DIVIDE((CWK_Valid - LWK_Valid), LWK_Valid, 0) * 100
)
VAR _total =
IF(ISBLANK(MAX('MDS Report'[Month])), 0,
IF(DISTINCTCOUNT('MDS Report'[Month]) > 1,
FORMAT(Change, "0.00") & " %",
FORMAT(SUM('MDS Report'[Quantity]), "")
)
)
RETURN COALESCE(_total, 0)
Hope it works, please check
Proud to be a Super User! | |
Sorry,
But it is still showing blank with no 0.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 36 | |
| 33 | |
| 29 | |
| 26 |
| User | Count |
|---|---|
| 134 | |
| 104 | |
| 63 | |
| 60 | |
| 55 |