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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
Anonymous
Not applicable

Rolling 12 month per month in a montly report

Hi,

 

I have a montly report where all data is filtered by a Slicer (e.g. 2024-12).

 

I have a measure that calculate Rolling 12M sales which for 2024-12 summarize Total sales for 2024-01 to 2024-12.

 

In this montly report I want to have a line chart that shows Rolling 12M per months the last 12 months which in above example show X-axis from 2024-01 to 2024-12 where 2024-01 summarizes sales from 2023-02 to 2024-01 (Rolling 12 at 2024-01)

 

Today, I try to use below DAX but this will only give me the value of 2024-12

 
Last12MonthsSales =
CALCULATE(
    [Total Sales],
    DATESINPERIOD('Date'[Date],max('Date'[Date]),-12,MONTH)
)

 

Anyone that could support?

 

2 ACCEPTED SOLUTIONS
anilelmastasi
Super User
Super User

Hello @Anonymous ,

 

Could you try this please?

 

Last12MonthsSales =
VAR CurrentDate = MAX('Date'[Date]) -- Get the current date in the context of the chart
RETURN
CALCULATE(
[Total Sales],
DATESINPERIOD('Date'[Date], CurrentDate, -12, MONTH) -- Rolling 12 months from each point on the X-axis
)

View solution in original post

Fowmy
Super User
Super User

@Anonymous 

It seems you need to be able to select a particular month and a chart to show past number of months, 12 in your case, check this video out: https://youtu.be/d8Rm7dwM6gc


Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

@Anonymous 

It seems you need to be able to select a particular month and a chart to show past number of months, 12 in your case, check this video out: https://youtu.be/d8Rm7dwM6gc


Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

anilelmastasi
Super User
Super User

Hello @Anonymous ,

 

Could you try this please?

 

Last12MonthsSales =
VAR CurrentDate = MAX('Date'[Date]) -- Get the current date in the context of the chart
RETURN
CALCULATE(
[Total Sales],
DATESINPERIOD('Date'[Date], CurrentDate, -12, MONTH) -- Rolling 12 months from each point on the X-axis
)

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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