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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
devika
Helper II
Helper II

Rolling 12 months

Hi all,

 

I'm trying to calculate rolling 12 months,

 

Rolling 12months =
CALCULATE(
   [TotalCases],
    DATESINPERIOD('Merge'[CASE_DATE],MAX(Merge_Annual_Mx_Vss[CASE_DATE]),-12,MONTH))
 

What I'm sorting is for Rolling 12 months, 2022Q3 = 2186

                                                           2022Q4 = 2186+1914=4100

                                                          2023 Q1=2186+1914+886=4986

 

 

I'm a bit stumped that this is not working for me, and I am not sure what I'm missing. 

 

devika_1-1677034371939.png

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@devika , Always use the date table joined with date of your table. If possible use the Window function

 

Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-12,MONTH))

Rolling Months Formula: https://youtu.be/GS5O4G81fww

 

Power BI Window function Rolling, Cumulative/Running Total, WTD, MTD, QTD, YTD, FYTD: https://youtu.be/nxc_IWl-tTc

View solution in original post

2 REPLIES 2
devika
Helper II
Helper II

Thanks, @amitchandak, for your reply and for sharing your knowledge; it worked when I joined the data table.

amitchandak
Super User
Super User

@devika , Always use the date table joined with date of your table. If possible use the Window function

 

Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],MAX('Date'[Date]),-12,MONTH))

Rolling Months Formula: https://youtu.be/GS5O4G81fww

 

Power BI Window function Rolling, Cumulative/Running Total, WTD, MTD, QTD, YTD, FYTD: https://youtu.be/nxc_IWl-tTc

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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