Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Running total based on multiple column

Hi Team,

 

Please help me on Running total calculation based on multiple columns as a slicers.

 

Please find the below data for your referance.

 

If I select HEAD as A, need output below.

If I select HEAD as A and YEAR as 2023, need output below.

 

If I select HEAD as A, Category as C1 and Org as HR then Expecting below out.

 

Thank you,

amitchandak , daXtreme Greg_Deckler Fowmy tamerj1 Jihwan_Kim 

 

  • Anonymous So you will never had a Value that is less than a "previous" row? If that is the case then you could do this:

    Measure = 
      VAR __Value = MAX('Table'[Value])
      VAR __Table = FILTER(ALLSELECTED('Table'),[Value] <= __Value)
    RETURN
      SUMX(__Table,[Value])

6 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Anonymous You are going to need an Index or Date column to allow you to define "before".

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Greg_Deckler 

      I am fine with Value column as INDEX,

       

      Thank you.

      • Greg_Deckler's avatar
        Greg_Deckler
        Community Champion

        Anonymous So you will never had a Value that is less than a "previous" row? If that is the case then you could do this:

        Measure = 
          VAR __Value = MAX('Table'[Value])
          VAR __Table = FILTER(ALLSELECTED('Table'),[Value] <= __Value)
        RETURN
          SUMX(__Table,[Value])