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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Do not evaluate else part of IF function if the condition is met

Hi Community,

 

I am facing some issues with the performance of the DAX code and it seems like I have found a bottleneck for it. 

 

Just for a background, in my reports, I show values for companies and for benchmarks. The benchmark logic is quite complex and has to compute more data than simply selected companies, that is why the default state of a report is only selected companies so that it will open up fast and then the user can select a benchmark additionally. 

 

All companies have positive number IDs and all benchmarks have negative number IDs. That's how we distinguish then. 

So, I have an IF function inside my DAX like this: 

IF(ID>0, [simple logic for comapines], [complex logic for benchmarks]). 

The formula itself works perfectly fine, however, even when we only looking at the selected companies the time for compution is still the same as it would've been for benchmarks. When I remove the else statement the loading time is less than 5 seconds, but when I add it back, even though the condition ID>0 is true and else statement should not be evalueated the loading time grows to 10-15 seconds. 

I have read it moght be because the eager evaluatio taking place, so we need to somehow trigger the strict evaluation so that only the first part of DAX is evaluated, but I could not fine a way to do it. 

I would appreaciate any ideas regardinf this. 

 

 

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , if this is column, then not having else means some rows will not be evaluated hence less time.

 

If this is measure try like

calculate([Simple logic], filter(Table, Table[ID] >0) ) + calculate([Complex logic], filter(Table, Table[ID] <0) )

 

 

if the result is text use & in place of +

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

thanks a lot for the idea, however, I have already tried this and it did not improve the performance 😞 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.