The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
@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 +
thanks a lot for the idea, however, I have already tried this and it did not improve the performance 😞
User | Count |
---|---|
27 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
31 | |
15 | |
12 | |
7 | |
6 |