Forum Discussion

harry6810's avatar
harry6810
Frequent Visitor
2 years ago
Solved

Stacked chart

Hey,

How can I create a stacked chart where each subsequent data point represents the cumulative sum of the previous values?

 

  • Hi harry6810 

     

    You would need to create a cumulative measure

    Culumative Amount =
    VAR MaxDate = MAX ( 'Date'[Date] ) 
    RETURN
        CALCULATE (
            [Sales Amount],   /// Sum of the amountin your table or a count of an id       
            'Date'[Date] <= MaxDate,  
            ALL ( Date )               
        )

     

    There are also a number of Time Intelligence measures you could use like

    TOTALYTD = TOTALYTD([SalesAmount], 'Date'[Date])
    TOTALQTD = TOTALQTD([SalesAmount], 'Date'[Date])
    TOTALMTD = TOTALMTD([SalesAmount], 'Date'[Date])

     

    Hope this helps

    Joe

1 Reply

  • Hi harry6810 

     

    You would need to create a cumulative measure

    Culumative Amount =
    VAR MaxDate = MAX ( 'Date'[Date] ) 
    RETURN
        CALCULATE (
            [Sales Amount],   /// Sum of the amountin your table or a count of an id       
            'Date'[Date] <= MaxDate,  
            ALL ( Date )               
        )

     

    There are also a number of Time Intelligence measures you could use like

    TOTALYTD = TOTALYTD([SalesAmount], 'Date'[Date])
    TOTALQTD = TOTALQTD([SalesAmount], 'Date'[Date])
    TOTALMTD = TOTALMTD([SalesAmount], 'Date'[Date])

     

    Hope this helps

    Joe