Forum Discussion

vijaykumarj19's avatar
vijaykumarj19
Icon for Microsoft Employee rankMicrosoft Employee
5 years ago
Solved

Cumulative total adding previous total twice

AxisActualCummulative  
a1555
a210205+5+10
a3155020+5+10+15
a42010050+5+10+15+20
a525175100+5+10+15+20+25

 

Required cummulative column 

  • v-jingzhang's avatar
    v-jingzhang
    5 years ago

    vijaykumarj19 I use below measures to get the output. Put [Total 1] in [Total 2].

    Total 1 = SUMX(FILTER(ALL('Tbl3'),'Tbl3'[Axis]<=MAX('Tbl3'[Axis])),'Tbl3'[Value])
    Total 2 = SUMX(FILTER(ALL('Tbl3'),'Tbl3'[Axis]<=MAX('Tbl3'[Axis])),[Total 1])

    I am struggling to get the output with only one measure but haven't figured it out.

6 Replies

  • vijaykumarj19 , Try a measure like

     

    calculate(sum(Table[Actual]), filter(allselected(Table), [Axis] < max(Table[Axis]))) + sum(Table[Actual])

    • vijaykumarj19's avatar
      vijaykumarj19
      Icon for Microsoft Employee rankMicrosoft Employee

      Current value is summing up with previous cummulative 
      But it should be added like below

       

       

      • v-jingzhang's avatar
        v-jingzhang
        Icon for Community Support rankCommunity Support

        Hi vijaykumarj19 , please try below measures.  Cumulative Total 3 is what you need.

        Cumulative Total 1 = CALCULATE(SUM(Tbl2[Value]),FILTER(ALL(Tbl2),Tbl2[Axis]<=MAX(Tbl2[Axis])))
        Cumulative Total 2 = CALCULATE(SUMX(VALUES(Tbl2[Axis]),[Cumulative Total 1]),FILTER(ALL(Tbl2),Tbl2[Axis]<=MAX(Tbl2[Axis])))
        Cumulative Total 3 = CALCULATE(SUMX(VALUES(Tbl2[Axis]),[Cumulative Total 2]),FILTER(ALL(Tbl2),Tbl2[Axis]<=MAX(Tbl2[Axis])))

         

        Kindly let me know if this helps.
        Community Support Team _ Jing Zhang
        If this post helps, please consider Accept it as the solution to help other members find it.