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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
jimpatel
Post Patron
Post Patron

3 months rolling sum

Hi,

 

Thanks for looking at my post. I am looking for some DAX formula for 3 months rolling sum of calculated column please? Any idea please?

Thanks a lot

jimpatel_0-1719837454927.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @lbendlin ,Thanks for your quick reply, I will add more.

Hi @jimpatel ,

The Table data is shown below:

vzhouwenmsft_0-1720408740313.png

Use the following DAX expression to create columns.

Column = 
YEAR('Table'[Date]) * 100 + MONTH('Table'[Date])
Rank = 
RANKX('Table',[Column],,ASC,Dense)
3 months rolling sum = 
VAR _rank = [Rank]
VAR _table = SUMMARIZE('Table',[Rank],[Calculated Column])
RETURN
SUMX(FILTER(_table,[Rank] <= _rank && [Rank] >= _rank - 2),[Calculated Column])

Final output

vzhouwenmsft_1-1720408818818.png

 

Best Regards,
Wenbin Zhou
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

5 REPLIES 5
Anonymous
Not applicable

Hi @lbendlin ,Thanks for your quick reply, I will add more.

Hi @jimpatel ,

The Table data is shown below:

vzhouwenmsft_0-1720408740313.png

Use the following DAX expression to create columns.

Column = 
YEAR('Table'[Date]) * 100 + MONTH('Table'[Date])
Rank = 
RANKX('Table',[Column],,ASC,Dense)
3 months rolling sum = 
VAR _rank = [Rank]
VAR _table = SUMMARIZE('Table',[Rank],[Calculated Column])
RETURN
SUMX(FILTER(_table,[Rank] <= _rank && [Rank] >= _rank - 2),[Calculated Column])

Final output

vzhouwenmsft_1-1720408818818.png

 

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

 

Thanks a lot. It works perfect.

jimpatel
Post Patron
Post Patron

Thanks for your reply. I got stuck with "3 months rolling Sum" section. The answer shown is expected.

 

Thanks a lot

Please provide sample data that fully covers your issue. Show more than three months of data.  Ideally in usable format, not as a screenshot.
Please show the expected outcome based on the sample data you provided.

lbendlin
Super User
Super User

Sounds straightforward (apart from the data duplication - why a calculated column?). What have you tried and where are you stuck?

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

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.