cancel
Showing results for
Did you mean:
Member

## Show Cumulative Running Total From Previous and current month

Hi all,

I'm currently struggling to get this data to show up on the current month, not the whole 12 months.

Here is my dataset

 Month Value Cumulative January 63 63 February 55 118 March 30 148 April 33 181 May 50 231 June 60 291 July 69 360 August 64 424 September 60 484 October 15 499 November 14 513 December 13 526 526 3838

This the formula I created. The total is the sum of Value column,

`Cumulative = CALCULATE([Total],FILTER(ALLSELECTED('Table1'),''Table1'[Month Num] <= MAX(''Table1'[Month Num])))`

So how do I get it to display from January to current month?

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Member

## Re: Display Cumulative Running Total from Previous up to Current Month

I figured it out how to stop the running total.

```Measure =
VAR Test = CALCULATE([Total] ,
FILTER(
ALLSELECTED(Table1) ,
Table1[Month Number] <= MAX(Table1[Month Number])))
RETURN
IF(MAX(Table1[Month Number]) +1 <= MONTH(TODAY()),
Test, BLANK())

```

3 REPLIES 3
Super User

## Re: Cumulative Rolling 12 Month

Hi @Stuznet,

Not really sure on the rest of the model and if you have date instead of month names, but looking at your data and if you want it to have the value until current month without the selection of any slicer you should redo your measure to something like this:

```Cumulative =
CALCULATE (
[Total],
FILTER ( ALLSELECTED ( 'Table1' ), 'Table1'[Month Num] <= MONTH ( TODAY () ) )
)```

Again your data is insuficient to test with your setup but should work.

Regards,

MFelix

Proud to be a Datanaut!

Member

## Re: Cumulative Rolling 12 Month

@MFelixThe formula you provided doesn't give me the correct result. It basically sum the total from Jan to oct and displaying the total in the column.

On my original data I do not have any date which make it difficult for me to create a date table. (Any suggestion?)

The only date I have is the Month Names table. I added an index column as a Month Number.

I would like to display the data from January to present month. So the next data dump, will be automatically show up on the chart and without selection of any slicer.

Member

## Re: Display Cumulative Running Total from Previous up to Current Month

I figured it out how to stop the running total.

```Measure =
VAR Test = CALCULATE([Total] ,
FILTER(
ALLSELECTED(Table1) ,
Table1[Month Number] <= MAX(Table1[Month Number])))
RETURN
IF(MAX(Table1[Month Number]) +1 <= MONTH(TODAY()),
Test, BLANK())

```