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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Rolling total needs changes by filter too

I have a problem which is driving me insane and as many times as I have tried I just can't get it to work.
So firstly I have two measures:
Measure 1 sums the number of ITPReviewed by area which works very well
1. AreaCumulative_ITP = SUMX(FILTER(ITP_InfoTable,
RELATED(Areas[Area]) <>""),
ITP_InfoTable[ITP Reviewed])

Measure 2 sums up the same things but based on the period
2. PeriodCumulative_ITP = CALCULATE(SUM(ITP_InfoTable[ITP Reviewed]),
FILTER( ALLSELECTED(ITP_InfoTable), ITP_InfoTable[Period] <= MAX(ITP_InfoTable[Period]) ) )

Now when I have the two in the table in Power BI (below)

GregRickshaw_0-1605026694448.png

Now when I filter by Period

GregRickshaw_1-1605026725656.png

I have the area and the Period in synch.

Now what I want to happen is when I remove January from the search/filter
I still need the Period Cummulative to keep the total values from previously, so the value in the first line should be 50 13+37 not 24 

GregRickshaw_2-1605026869848.png

Any ideas on how I can achieve this mini cumulative value

Thanks

 

Greg

 

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , In all such case, have a period table or date table as a separate table and then you can use all in place of allselected.

In case you do not have date  you can create one based on your format

Date = "01-" & [Month] &"-" &[Year] // change data type as date

 

In case you only need year wise use YTD

example

YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(date),date[date] <=max(date[date])))

or

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(all(date),date[date] <=max(date[date])))

 

Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-12,MONTH))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

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

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.