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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
jonnyA
Responsive Resident
Responsive Resident

I need a formula for a 12 Month Rolling Average. Hoping to use a quick measure.

I need a formula for a 12 Month Rolling Average. Hoping to use a quick measure.  Can anyone help?

 

For example, if i had 2 years worth of data, lets say all of 2020 and all of 2021 and I only want to bring back the 12 Month Average of the last 12 months.  How can I do that?

 

 

jonnyA_0-1657307444478.png

 

 

CPT  = cOUNTROWS (

groupby (Dataset,Dataset[Date_of_Service],Dataset[Patient_FullName],Dataset[Provider_name],Dataset[Procedure_Code], Dataset[Visit_Type_Status], Dataset[Voucher_Number] ))

 

 

 

 

1 ACCEPTED SOLUTION
jonnyA
Responsive Resident
Responsive Resident

Last 12 Months V1 =

CALCULATE (

[CPT Working],

DATESINPERIOD (

'Calendar'[dt], -- returns period from date column

MAX ( 'Calendar'[dt] ), -- starting from MAX date

-12, -- shifting it back 12 intervals

MONTH -- each interval being a month

)

)

--------------------------

Then ...

365 = 365

---------------------------------

Then ... 

 

Last 12 Months V1 divided by 365 =

DIVIDE([Last 12 Months V1], [365])

 

View solution in original post

2 REPLIES 2
jonnyA
Responsive Resident
Responsive Resident

Last 12 Months V1 =

CALCULATE (

[CPT Working],

DATESINPERIOD (

'Calendar'[dt], -- returns period from date column

MAX ( 'Calendar'[dt] ), -- starting from MAX date

-12, -- shifting it back 12 intervals

MONTH -- each interval being a month

)

)

--------------------------

Then ...

365 = 365

---------------------------------

Then ... 

 

Last 12 Months V1 divided by 365 =

DIVIDE([Last 12 Months V1], [365])

 

Anonymous
Not applicable

i jopnnyA

 

Look at this video all is explain

https://www.youtube.com/watch?v=ACvYaXnpyCM

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

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