Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Measure dynamically

Good morning guys

I need to create a dax measure for each row of a column of a table dynamically. How to do this?

 

Observation: I'm doing it like this because I need to describe the values ​​of this dimension in a line chart with the accumulated total. Without creating a measure for each row, I can't show the cumulative total

 

Thanks is advance 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi  Anonymous ,

    I created some data:

    If you want to calculate the cumulative total, you can use the following dax:

    Create measure.

    accumulated total =
    CALCULATE(SUM('Table'[amount]),FILTER(ALL('Table'),'Table'[date]<=MAX('Table'[date])))

    Result:

     

    Best Regards,

    Liu Yang

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

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  Anonymous ,

    I created some data:

    If you want to calculate the cumulative total, you can use the following dax:

    Create measure.

    accumulated total =
    CALCULATE(SUM('Table'[amount]),FILTER(ALL('Table'),'Table'[date]<=MAX('Table'[date])))

    Result:

     

    Best Regards,

    Liu Yang

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

    • Brinki's avatar
      Brinki
      Frequent Visitor

      and what about cummulative totals for last year?

  • Anonymous Hi!

    Can you provide sample data on which to calculate the measure and the result you expect to obtain?

     

    BF