Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Cumulative total for my data model

Hello please help me to calculate cumulative based on this data model. In my data model there is no date sorting and most of the solutions on the internet are based on this. 

in my data model index corresponds to value month so for each month of an year we have value months which have data points. picture 1 shows graph based on this data model.

And picture 2 shows the desired result. 

So for the month may the graph shoud show april and may=april+may

similarly for december graph 2 must show till value month december

image.png

image.pngimage.png

 

thank you in advance.

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please refer the formula.

Measure = CALCULATE(SUM('Table'[value]),FILTER(ALLSELECTED('Table'),'Table'[index]<=MAX('Table'[index])))

Result would be shown as below.

2.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

4 REPLIES 4
v-jayw-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please refer the formula.

Measure = CALCULATE(SUM('Table'[value]),FILTER(ALLSELECTED('Table'),'Table'[index]<=MAX('Table'[index])))

Result would be shown as below.

2.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
amitchandak
Super User
Super User

@Anonymous , Try

Create a new column

Date = "01-" & [Month] & "-" [year] //Change data type to date

 

and then measure

Cumm ACTUAL+FORECAST = CALCULATE(SUM(Table[Value]),filter(allselected(Table),Table[date] <=max(Table[Date]) && Table[Type] = "ACTUAL+FORECAST"))

 

Cumm BUDGET = CALCULATE(SUM(Table[Value]),filter(allselected(Table),Table[date] <=max(Table[Date]) && Table[Type] = "BUDGET"))

Anonymous
Not applicable

@amitchandak  the months on x axis are from value month column.

So from each month we have 12 value months, index represents value month in fiscal numbering.

so I need for every month there should be a cumulative total till that value month 

eg., for month apr chart 2 shows value month apr

       for month may chart 2 shows value month apr and apr+may

      for month jun  chart 2 shows value month apr , apr+may and apr+may+jun

I you get this data model please help me

@Anonymous , That is like YTD, Better create a date  table and use YTD

 

YTD = CALCULATE(SUM(Table[Value]),DATESYTD('Date'[Date],"3/31"), filter(Table, Table[Type] = "ACTUAL+FORECAST"))  //end of year is march

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.