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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.

Top Solution Authors