Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Need help formatting data structure.

Hi so I have a data source that gives a sales persons numbers in this format:

DateSale amount
4/1/20$100
6/1/20$200
6/3/20$200

 

I need to be able to format the data so it becomes a cumulative total and includes all the months up to the current month.

DateSales Amount (Cumulative Total)
4/1/20$100
5/1/20$100
6/1/20$500
7/1/20$500
8/1/20$500

 

Any ideas on how to create a data table that has this structure?

 

Thanks as always!!

  • Hi Anonymous 

    first create a calendar table

    Calendar = CALENDARAUTO()

    then you can create whether a calculated column

    Sales Amount (Cumulative Total) =
    CALCULATE(SUM(Table[Sale amount]), FILTER(ALL(Table]), Table[Date] <= EARLIER(Calendar[Date])))

    or measure 

    Sales Amount (Cumulative Total) =
    CALCULATE(SUM(Table[Sale amount]), FILTER(ALL(Table]), Table[Date] <= MAX(Calendar[Date])))

     for this calendar table

5 Replies