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.
Please try this expression for your first measure instead.
Board10d7TaxAmountWithSignActualBudgetActualized =
VAR Result = [Board10cP&LAllTransactionAmountwithSignBudgetActualized]
VAR TaxApplicable =
-1
* MIN (
[Board10d5TaxCalcPeriodActualBudgetActualized],
[Board10d6TaxCalcCumulativeActualBudgetActualized]
)
RETURN
IF ( SELECTEDVALUE ( TabPLGLItem[GLItem] ) = "Tax", TaxApplicable, Result )Pat
- Ackbar-Learner3 years agoResolver I
ppm1 , thanks for your reply. The code does give me the result but it does not improve the performance. I'll explain the measures leading to this measure in a post just below this and tag you again. Hopefully, you can find something which I could not see!
- ppm13 years agoSolution Sage
Please see my recent video on how to isolate and test each of your measures to see which is the worst performer. My guess it that it is one or both of the SUMX ones where you have a measure evaluated on each row (1b and 6b).
https://www.youtube.com/watch?v=ScJVQoOWSqc
Pat
- Ackbar-Learner3 years agoResolver I
@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.