Forum Discussion
Measure taking too long
- Anonymous3 years ago
Hello Ackbar-Learner , too many ifs will cause performance issues, your best bet is to put those ifs in a var result = (your if formula) the return result.
This will boost your performance a bit
Try avoiding too many ifs across many measures .what i mean
Measure1 = if(name = value, calc,0)
Then you do another measure
Measure2= if(measure1>0,calc2,calc)
Then you do another measure:
Measure3 = if(measure2 =measure1,calc3,0)
The above is a complete random example to help you understand that this will cause performance issue because poeerbi have to recalculate all the ifs of all measures inside measures.
Putting those measure in var first
Measure1 =
var cond= if(name = value,calc,0)
Return cond
... this might help boost your performance
- 3 years ago
@ppm this is a nice video. I watched the one after and tried to do the same to my model. I won't say it worked perfectly but it is much more improved now.
As for the measure, which is taking a lot of time; it is the sheer amount of data, which is causing this issue. Once i optimized a bit more on the filter, it got much better.
Thanks a lot.
Hello Ackbar-Learner , too many ifs will cause performance issues, your best bet is to put those ifs in a var result = (your if formula) the return result.
This will boost your performance a bit
Try avoiding too many ifs across many measures .what i mean
Measure1 = if(name = value, calc,0)
Then you do another measure
Measure2= if(measure1>0,calc2,calc)
Then you do another measure:
Measure3 = if(measure2 =measure1,calc3,0)
The above is a complete random example to help you understand that this will cause performance issue because poeerbi have to recalculate all the ifs of all measures inside measures.
Putting those measure in var first
Measure1 =
var cond= if(name = value,calc,0)
Return cond
... this might help boost your performance
Anonymous
Following your reply, i have relooked at the DAX formulas completely and came up with a new set leading to the same results. I think I have been able to optimize where I could and it is still slow but much better than before.
I used Performance Analyzer and understood that I was calculating too much data on the visual and had to filter it way at the start to make it a bit more practical.
Thanks a lot though; this post opened my mind to a lot of new things in Power BI.