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!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi,
I have an existing function that's not returning correct results. Appreciate any help please @amitchandak @Jihwan_Kim
X Proc Resc (Format) =
var _val = [X Proc Resc]
var _test = [X Del Resc] + [X Carryover] + [X Aged Freight]
return
SWITCH(TRUE(),
_test >=0 && _val >=0, FORMAT(_val, "##0.0%"),
_test >=0 && _val =BLANK(), FORMAT(_val, "General Number"))
As per screenshot, the expected results for the highlighted "Branch" column should be:
| Branch | X Del Resc | X Proc Resc | X Proc Resc (Format) | X Carryover | X Aged Freight |
| Auckland South | |||||
| Auckland West | 0.0% | 50.0% | 50.0% | ||
| Blenheim | 0 | 0 |
Solved! Go to Solution.
@lbendlin yes you're right and I forgot to mention that. So I've managed to solve my issue by tweaking the dax and it's showing expected results.
X Proc Resc (Format)1 =
var _val = [X Proc Resc]
var _test = [X Del Resc] + [X Carryover] + [X Aged Freight]
var _result =
SWITCH(TRUE(),
NOT(ISBLANK(_test)) && NOT(ISBLANK(_val)), FORMAT(_val,"##0.0%"),
NOT(ISBLANK(_test)) && ISBLANK(_val), FORMAT(0, "General Number"))
return
_result
You can't report on things that aren't there unless you perform extra steps like adding 0 to the measure or using disconnected tables and cross joins.
@lbendlin yes you're right and I forgot to mention that. So I've managed to solve my issue by tweaking the dax and it's showing expected results.
X Proc Resc (Format)1 =
var _val = [X Proc Resc]
var _test = [X Del Resc] + [X Carryover] + [X Aged Freight]
var _result =
SWITCH(TRUE(),
NOT(ISBLANK(_test)) && NOT(ISBLANK(_val)), FORMAT(_val,"##0.0%"),
NOT(ISBLANK(_test)) && ISBLANK(_val), FORMAT(0, "General Number"))
return
_result
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 14 | |
| 9 | |
| 7 | |
| 7 | |
| 6 |