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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Joey_
Frequent Visitor

Rolling average not working for all days after slicing clients

Hello!

I have created a measure to calculate the rolling average of the money flow from my company's funds over the last 30 days, it works beautifully, and the calculation is done for everyday. But the problem is that after slicing clients, the calculation is no longer done for every day, but only for the dates when that particular client had impact on the money flow. This reduces the usability of the rolling average chart, i only want the money flow to be sliced by client, not the dates in which the calculation is being done. Here is the code from my measure: 

m_MedMov 30 =

var first_date = CALCULATE(FIRSTDATE('d_Calendario'[Date]), FILTER(ALL('d_Calendario'), [money_flow] <> BLANK()))

var rolling_sum = CALCULATE([money_flow], DATESINPERIOD('d_Calendario'[Date], LASTDATE('d_Calendario'[Date]), - 30, DAY)

return

IF(SELECTEDVALUE('d_Calendario'[Date]) > first_date + 30 && SELECTEDVALUE('d_Calendario'[Date]) <= MAX('d_Calendario'[Date]), rolling_sum / 30, BLANK())

Can anyone please shed some light on wether there is a solution for this?

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@Joey_ Try: Better Rolling Average - Microsoft Power BI Community



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thanks a lot for the suggestion, but that does not solve my problem. I need the rolling average to be calculated for every single day, regardless of data slicing.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.

Top Solution Authors
Top Kudoed Authors