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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Richard79
Regular Visitor

12 month rolling with variables

Hi, 

 

I have done som reaserch on how to get a calculation on 12 month rolling details. I have not found a soultion that works because of the way my date table is set up. The value i need is 12 month rolling for each month for the collum NPT and Operation hours (duration). Then i need to calculate monthly 12 month rolling 12 month NPT in % of 12 month Operating hours

Richard79_0-1628752602118.png

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Richard79 

Try a measure like this :

12 Months NPT=
Var MaxDate = MAX ( Dates[Date] )
Var MinDate = CALCULATE ( MIN ( Dates[Date] ), FILTER ( ALL ( Dates ), DATEADD ( Dates[Date], 1, YEAR ) "Greaterthan" SelectedMaxDate ) )
Return
CALCULATE ( SUM ( Table[NPT] ), ALL ( Dates ), Dates[Date] "LessThanOrEqualTo" SelectedMaxDate, Dates[Date] "GreaterThanOrEqualTo" MinDate )

Best Regards

Community Support Team _ Ailsa Tao

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

1 REPLY 1
Anonymous
Not applicable

Hi @Richard79 

Try a measure like this :

12 Months NPT=
Var MaxDate = MAX ( Dates[Date] )
Var MinDate = CALCULATE ( MIN ( Dates[Date] ), FILTER ( ALL ( Dates ), DATEADD ( Dates[Date], 1, YEAR ) "Greaterthan" SelectedMaxDate ) )
Return
CALCULATE ( SUM ( Table[NPT] ), ALL ( Dates ), Dates[Date] "LessThanOrEqualTo" SelectedMaxDate, Dates[Date] "GreaterThanOrEqualTo" MinDate )

Best Regards

Community Support Team _ Ailsa Tao

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

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.