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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Filtered Date RunningTotal

Hi,

I am using a cumulative total calculation to display a running total of a value throughout the year. The calculation is as follows:

Running Total = 
CALCULATE(SUM(Table[Amnt]),
	FILTER(
		ALLSELECTED('Date Dim'[Date]),
		'Date Dim'[Date] <= MAX('Date Dim'[Date]) 
        )
)

This works perfectly, and gives my cumulative total for my two years of data.

 

However, I want to be able to filter to Current Year, and Current Year + 1 so build the column in "Date Dim":

Year Filter = IF(YEAR('Date Dim'[Date]) == YEAR(TODAY()), "CY",
                         IF(YEAR('Date Dim'[Date]) == YEAR(TODAY())+1, "CY+1",BLANK()))
But when I filter to CY+1, the running total is still running from the current year. I want the running total to reset when filtered to CY+1 and start again from zero.
Is anyone able to help?
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

Try using something like

Using YTD = TOTALYTD(SUM(Sales[Sales Amount]),'Date'[Date Filer])

Refer page 9 on the link https://www.dropbox.com/s/tu56wooipvoyoy3/CompareRange_timedim_YearTillDate.pbix?dl=0

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

5 REPLIES 5
IanCockcroft
Post Patron
Post Patron

Wont CALCULATE() ignore any filters you have used?

Anonymous
Not applicable

@IanCockcroft  not that I am aware of. If I filter by anything else (lets say market), the values will change to reflect that filter

HI, @Anonymous 

You just need to adjust your formula as below:

NEW Running Total = 
CALCULATE(SUM('Table'[Amnt]),
	FILTER(
		ALLSELECTED('Date Dim'),
		'Date Dim'[Date] <= MAX('Date Dim'[Date]) 
        )
)

Because for your formula, It just removes context filters from column 'Date Dim'[Date], other columns in 'Date Dim' table won't be affected.

 

Regards,

Lin

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

Try using something like

Using YTD = TOTALYTD(SUM(Sales[Sales Amount]),'Date'[Date Filer])

Refer page 9 on the link https://www.dropbox.com/s/tu56wooipvoyoy3/CompareRange_timedim_YearTillDate.pbix?dl=0

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thank you @amitchandak , thats worked great.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.