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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Rolling 13 Months Sum DAX

Hi friends,

 

I am trying to create Rolling 13 months sum using DAX and I am looking for some help around it.

 

This is my data set. And I want to create a measure and not a column which gives me Rolling 13 months sale for the month I select in the filter.

Data Set:

 

Month YearSale
Apr-211000
May-21200
Jun-213000
Jul-211200
Aug-211500
Sep-211600
Oct-211300
Nov-212000
Dec-211000
Jan-222000
Feb-223000
Mar-221000
Apr-221000
May-222000
Jun-221000

 

Result Expected:

 

Month YearRolling 13 Month Sale
Apr-2219800
May-2220800
Jun-2221600

 

Thanks

2 ACCEPTED SOLUTIONS
danextian
Super User
Super User

Hi @Anonymous ,

 

This measure below will work if you have a date column in your table. It won't work if you have only the month name as it is a text.

Measure = 
CALCULATE(
    SUM( 'Table'[Sale] ),
    DATESINPERIOD( 'Table'[DateRef], MAX( 'Table'[DateRef] ), -13,  MONTH )
)

 

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Thanks Ashish for your help and time.

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
danextian
Super User
Super User

Hi @Anonymous ,

 

This measure below will work if you have a date column in your table. It won't work if you have only the month name as it is a text.

Measure = 
CALCULATE(
    SUM( 'Table'[Sale] ),
    DATESINPERIOD( 'Table'[DateRef], MAX( 'Table'[DateRef] ), -13,  MONTH )
)

 

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Anonymous
Not applicable

Hi mate, thans for your time and help, it worked.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

March Power BI Update Carousel

Power BI Community Update - March 2026

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