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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
Anonymous
Not applicable

Rolling sum without filter all function

Hi all,

 

Having some problems with my rolling sum function below, I have slicers on the page so when I use the Filter(ALL( function it removes the interaction with the sliders. Is there anyway to calculate rolling sums without FILTER(ALL)?

 

Annual_Numeratorr_Rolling =
var _sum12=
CALCULATE (
SUM ( 'PowerBI(Index)'[Total Return Numerator ("calculated reutrn" tab, Column K)] ),
FILTER (
ALL('PowerBI(Index)'),
EOMONTH ( 'PowerBI(Index)'[Return_id], 0 )
<= EOMONTH(MAX([Return_id]),0)&&EOMONTH('PowerBI(Index)'[Return_id],0)>EOMONTH(MAX([Return_id]),-12)
)
)
return IF(HASONEVALUE('PowerBI(Index)'[Return_id]),_sum12,SUM('PowerBI(Index)'[Total Return Numerator ("calculated reutrn" tab, Column K)]))
1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous 

You can change all() to ALLSELECTED()

Before not selected:

Vpazhenmsft_2-1630487018445.png

After the slicer is selected:

Vpazhenmsft_3-1630487034010.png

the ALL function ignores all filters, regardless of where they are coming from. In contrast, the ALLSELECTED function only ignores filters that are coming from the inner query.

This is the difference between all() and ALLSELECTED():

https://community.powerbi.com/t5/Community-Blog/What-s-the-Main-Difference-Between-ALL-amp-ALLSELECT...

https://mitchellpearson.com/2020/09/14/understanding-row-context-in-dax-and-power-bi/

 

Best Regards,

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@Anonymous 

You can change all() to ALLSELECTED()

Before not selected:

Vpazhenmsft_2-1630487018445.png

After the slicer is selected:

Vpazhenmsft_3-1630487034010.png

the ALL function ignores all filters, regardless of where they are coming from. In contrast, the ALLSELECTED function only ignores filters that are coming from the inner query.

This is the difference between all() and ALLSELECTED():

https://community.powerbi.com/t5/Community-Blog/What-s-the-Main-Difference-Between-ALL-amp-ALLSELECT...

https://mitchellpearson.com/2020/09/14/understanding-row-context-in-dax-and-power-bi/

 

Best Regards,

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

@Anonymous , have you tried a measure like

 

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

 

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

 

tiill last month

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

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
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.