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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Stijn06
New Member

Accumulated Total with filtering

Hello,

 

I've made a accumulated sum per month / year:

Accumulated = CALCULATE (SUM ( 'Turnover Monthly'[Gross Invoiced] ),FILTER (ALL ( 'Turnover Monthly' ),'Turnover Monthly'[Date Invoice Day Month Year] <= MAX ( 'Turnover Monthly'[Date Invoice Day Month Year] )&& 'Turnover Monthly'[Date Invoice Year] = MAX ( 'Turnover Monthly'[Date Invoice Year] )))
 
But now when I filter on another slicer (for instance 'Sales District'), the accumulated sum (measure) per month doesn't change to that district but keeps giving the total.
 
What goes wrong ?
 
Thanks in advance
Stijn
1 ACCEPTED SOLUTION
Adescrit
Impactful Individual
Impactful Individual

Hi @Stijn06 

The issue is being caused by the ALL function in your DAX. This function is telling the CALCULATE function to remove / ignore all filters applied to the 'Turnover Monthly' table, regardless of whether those filters are applied within the DAX statement itself or via slicers in the report.

To overcome the issue you should create a Calendar dimension table, if you haven't already. Connect this calendar dimension table to your 'Turnover Monthly' table and apply the filters in your CALCULATE function (including the ALL function) to the dimension table instead of the Turnover Monthly table.

So your DAX would look something like this:

Accumulated = CALCULATE (SUM ( 'Turnover Monthly'[Gross Invoiced] ),FILTER (ALL ( 'Calendar' ),'Calendar'[Date Invoice Day Month Year] <= MAX ( 'Calendar'[Date Invoice Day Month Year] )&& 'Calendar'[Date Invoice Year] = MAX ( 'Calendar'[Date Invoice Year] )))



Did I answer your question? Mark my post as a solution!
My LinkedIn

View solution in original post

1 REPLY 1
Adescrit
Impactful Individual
Impactful Individual

Hi @Stijn06 

The issue is being caused by the ALL function in your DAX. This function is telling the CALCULATE function to remove / ignore all filters applied to the 'Turnover Monthly' table, regardless of whether those filters are applied within the DAX statement itself or via slicers in the report.

To overcome the issue you should create a Calendar dimension table, if you haven't already. Connect this calendar dimension table to your 'Turnover Monthly' table and apply the filters in your CALCULATE function (including the ALL function) to the dimension table instead of the Turnover Monthly table.

So your DAX would look something like this:

Accumulated = CALCULATE (SUM ( 'Turnover Monthly'[Gross Invoiced] ),FILTER (ALL ( 'Calendar' ),'Calendar'[Date Invoice Day Month Year] <= MAX ( 'Calendar'[Date Invoice Day Month Year] )&& 'Calendar'[Date Invoice Year] = MAX ( 'Calendar'[Date Invoice Year] )))



Did I answer your question? Mark my post as a solution!
My LinkedIn

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors