Forum Discussion

Ackbar-Learner's avatar
Ackbar-Learner
Resolver I
3 years ago
Solved

Measure taking too long

Hi I have a measure which is taking too long to calculate. All measures which precede this delaying measure are ok and do not take much time. See measure below:     Board10d7TaxAmountWithSignAct...
  • Anonymous's avatar
    Anonymous
    3 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 

  • Ackbar-Learner's avatar
    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.