Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
brdrok
Helper I
Helper I

Query timeout question (i.e Query has exceeded the available resources)

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:

COALESCE
(
    result,
    0.00
)
or the ISBLANK function:
 IF
 (
     ISBLANK
     (
         result
     ),
    0.00,
     result
 )
 



 

 

3 REPLIES 3
brdrok
Helper I
Helper I

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.

SamanthaPuaXY
Helper II
Helper II

Hi @brdrok ,
Do you have a screenshot of the error? I tried either and it works 

SamanthaPuaXY_0-1740619395262.png

 

lbendlin
Super User
Super User

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

 

Helpful resources

Announcements
FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.