Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Cumulative Total Issue

Hello,

 

When I want to make cumulative total for my table that you can see below, my formula returns wrong cumulative total for each distributor row. Can you help me to solve this issue ? (What I want is to see %18,7 1.row - % 32,1 2.row - 39,1 3.row etc.)

 

 

My cumulative total formula :

 

 

  • Anonymous 

     

    Try:

     

     

     

    RANKX % Sum ratio = RANKX(ALL(table[DistName]); [Sum Ratio]; ;DESC)

     

     

     

     

    Followed by:

     

     

     

    Cumulative % Sum Ratio = SUMX(TOPN([RANKX % Sum ratio]; ALL(table[DistName]); [Sum Ratio]); [Sum Ratio])

     

     

     

    And to get rid of the total:

     

     

     

    Cumulative without total in matrix = IF(ISINSCOPE(table[DistName]); [Cumulative % Sum Ratio]; BLANK())

     

     

8 Replies

  • Hi Anonymous ,

     

    Please give a try to below DAX Measure:

     

     

    Cumulative Sum=
    CALCULATE ( SUM ( 'Table'[Sum Ratio] ), FILTER ( ALL ( 'Table' ), 'Table'[DateColumn] <= MAX ( 'Table'[DateColumn] ) ) )

    Please give Kudos this effort and mark it as a solution if it helps!!!

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Dear Tahreem24 ,

       

      Unfortunately formula you type does not work. You can see the result below :

       

      Apart from that, why do I need to use date formula ?

       

      Best Regards.

       

      • amitchandak's avatar
        amitchandak
        Super User

        You are using calendar date, I think you should use DistName

  • PaulDBrown's avatar
    PaulDBrown
    Community Champion

    Anonymous 

     

    Try:

     

     

     

    RANKX % Sum ratio = RANKX(ALL(table[DistName]); [Sum Ratio]; ;DESC)

     

     

     

     

    Followed by:

     

     

     

    Cumulative % Sum Ratio = SUMX(TOPN([RANKX % Sum ratio]; ALL(table[DistName]); [Sum Ratio]); [Sum Ratio])

     

     

     

    And to get rid of the total:

     

     

     

    Cumulative without total in matrix = IF(ISINSCOPE(table[DistName]); [Cumulative % Sum Ratio]; BLANK())