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
KG1
Resolver I
Resolver I

Month on Month Rolling Avg

Hi

 

I have the following measure

KG1_0-1649235686173.png

I need to able to show month on month rolling avg in a visual

KG1_1-1649235740721.pngKG1_2-1649235754671.pngKG1_3-1649235772762.png

The total 1.2 is correct for the last 12 months - how do I show this month on month rather than just actuals for each month

 

Thank you in advance

2 ACCEPTED SOLUTIONS

Sorry - I cant get it to work 😞

KG1_0-1649241199399.pngKG1_1-1649241216705.png

Rolling 12 =
var _max = maxx(ALLSELECTED(SHEQ[Month]),SHEQ[Month]) // or today()
var _min = date(year(_max), month(_max)-12,1)
return
CALCULATE(AverageX(values('SHEQ'[Month]) , [NLTI Calc]) ,filter(SHEQ, SHEQ[Month] <=_max && SHEQ[Month] >=_min) , allselected() )

View solution in original post

v-kkf-msft
Community Support
Community Support

Hi @KG1 ,

 

Please try the following formula:

 

Measure = 
CALCULATE (
    [Total NLTI's] / [Total Working Hours] * 10 ^ 5,
    FILTER ( ALLSELECTED ( SHEQ ), SHEQ[Month] <= MAX ( SHEQ[Month] ) )
)

vkkfmsft_0-1649741505463.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
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

4 REPLIES 4
v-kkf-msft
Community Support
Community Support

Hi @KG1 ,

 

Please try the following formula:

 

Measure = 
CALCULATE (
    [Total NLTI's] / [Total Working Hours] * 10 ^ 5,
    FILTER ( ALLSELECTED ( SHEQ ), SHEQ[Month] <= MAX ( SHEQ[Month] ) )
)

vkkfmsft_0-1649741505463.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Great  - thank you - that worked perfectly

amitchandak
Super User
Super User

@KG1 , try like

 

Rolling 12 =
var _max = maxx(allselcted(date),date[date]) // or today()
var _min = date(year(_max), month(_max)-12,1)
return
CALCULATE(AverageX(values('Date'[Month Year]) , [NLTI Calc]) ,filter(date, date[date] <=_max && date[date] >=_min))

 

and for Gt in all rows

 

Rolling 12 GT =
var _max = maxx(allselcted(date),date[date]) // or today()
var _min = date(year(_max), month(_max)-12,1)
return
CALCULATE(AverageX(values('Date'[Month Year]) , [NLTI Calc]) ,filter(date, date[date] <=_max && date[date] >=_min) , allselected() )

Sorry - I cant get it to work 😞

KG1_0-1649241199399.pngKG1_1-1649241216705.png

Rolling 12 =
var _max = maxx(ALLSELECTED(SHEQ[Month]),SHEQ[Month]) // or today()
var _min = date(year(_max), month(_max)-12,1)
return
CALCULATE(AverageX(values('SHEQ'[Month]) , [NLTI Calc]) ,filter(SHEQ, SHEQ[Month] <=_max && SHEQ[Month] >=_min) , allselected() )

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.