Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Optimize performance for running totals

Dear all, I am struggling with optimizing the performance of a measure to calculate the running totals. Currently my DAX measure looks like below, but this measure is not performing in the way I wou...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Your idea is so great Greg_Deckler 

    Hi, Anonymous 

    If you want to optimize the performance of SUMX, you can refer to the following articles:

    Optimizing callbacks in a SUMX iterator - SQLBI

     

     

     

    How to Get Your Question Answered Quickly

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

    Best Regards

    Jianpeng Li

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Greg_Deckler's avatar
    Greg_Deckler
    2 years ago

    Anonymous Perhaps try:

    Better RT =
      VAR _MaxDate = MAX( 'Date'[DateId] )
      VAR _Table = SUMMARIZE( ALL('BottomUp'), [DemandDateId], "_Value", SUM('BottomUp'[DemandQty]) )
      VAR _Result = SUMX( FILTER( _Table, [DemandDateId] <= _MaxDate ), [_Value] )
    RETURN
      _Result