The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello,
I've made a accumulated sum per month / year:
Solved! Go to Solution.
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] )))
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] )))