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,
I have a DAX question regarding why one query times out while the other one does not. The query below runs in 500ms or so
ShortTermGainLoss =
var curSTFLag = SELECTEDVALUE(FactGL[STFlag], BLANK())
var curRGL = [RGL]
var result = if(curSTFLag = "ST", curRGL , BLANK()) ---- 500ms
RETURN
result
Essentially the same query except the BLANK() is replaced with a variable named curZero
ShortTermGainLoss =
var curSTFLag = SELECTEDVALUE(FactGL[STFlag], BLANK())
var curRGL = [RGL]
var curZero = 0.00
var result = if(curSTFLag = "ST", curRGL , curZero) ---- times out
RETURN
result
Preferably I would like to show $0.00 as opposed to Blank. I hope someone can provide me with a cliff note version as to why that is and how to code around that. Thank you.
P.S.
Tried wrapping the "result" variable in either the COALESE function like so:
Sorry for letting the question die. I have moved the logic into a calculated column. No my favorite choice but I don't want to spend more on it. Thank you.
Connect DAX Studio to whatever instance you are using for this (local or service) and then compare the query plans and server timings.
Preferably I would like to show $0.00 as opposed to Blank.
Make sure your users are ok with that. The absence of something does not necessarily equate to $0
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 145 | |
| 125 | |
| 107 | |
| 79 | |
| 54 |