cancel
Showing results for
Did you mean:

Cumulative values with start and end date

Hello

I would like to achieve the following.

Have two date targeting filters such as these:

Select year and a final date, and that I will get the accumulated amount for each month of the current year selected.

If I select year 2018 and end date 31/03/2018, it should come out:

January 2018: xxxx (where xxxx is accumulated from 1/1/2016 to 31/01/2018)

February 2018: xxxx (where xxxx is accumulated from 1/1/2016 to 31/02/2018)

March 2018: xxxx (where xxxx is accumulated from 1/1/2016 to 31/03/2018)

Thank you.

1 ACCEPTED SOLUTION
Community Support

You could create a measure as follow:

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

The final show:

Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 REPLIES 3
Community Support

You could create a measure as follow:

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

The final show:

Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello

The measure you say I already have but it does not do what I want, it simply makes me the total until the maximum date selected but does not give me results per month.

Super User

Cumm Sales =
Var _max =max('Date'[date])
return
CALCULATE(SUM(Sales[Sales Amount]),filter(allselected('Date'),'Date'[date] <= _max))

or

Cumm Sales =
Var _max =max('Date'[date])

Var _max1 =maxX(allselected('Date') , 'Date'[date])
return
CALCULATE(SUM(Sales[Sales Amount]),filter(all('Date'),'Date'[date] <= _max && 'Date'[date] <= _max1   ))

Learn Power BI - Full Course with Dec-2022, with new DAX functions like Window, Index, Offset !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Formatted Profit and Loss Statement with empty lines

Announcements

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.

Top Solution Authors
Top Kudoed Authors