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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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 )
)

 

 

 










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


Proud to be a Super User!









"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 )
)

 

 

 










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


Proud to be a Super User!









"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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors