cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

Frequent Visitor

## Calculate Rolling 12 Month Average Headcount

Hi Experts,

My formula for Headcount is working fine for each month as shown below
It's just that I don't understand how to calculate 12 Month Rolling Average of this Headcount shown

I know many have asked this question before, but all the approaches are doing average of a column from a table
My question is different because I have to do average of a measure over 12 months rolling for a given month

1 ACCEPTED SOLUTION
Frequent Visitor

Attaching solution just in case it helps anyone

Sincere Kudos to @Ahmedx  and SQLBI

7 REPLIES 7
Frequent Visitor

Attaching solution just in case it helps anyone

Sincere Kudos to @Ahmedx  and SQLBI

Super User
Frequent Visitor

Just implemented it- was reading the same article

This did not work too, the answer is still the same

This is because my measure Headcount, being evaluated, in itself is Date Dependent, I feel

Thanks for sharing your time on this with me, I am trying as well
ChatGPT for sure isn't being helpful- lol

Frequent Visitor

@Ahmedx This did not work too

Frequent Visitor

@Ahmedx Hi There,
Thanks for helping me
I used this myself

With both of these, my Headcount becomes = Rolling Avg HC of 12 Months

This is becvause my Headcount formula shared above in question is dynamic and uses the Year and Month in Row to calculate itself dynamically each row

Super User

Super User

write the new measure like this

`````` NewMeasure = CALCULATE ( [Headcount],

DATESINPERIOD('Calendar'[Date],MAX('Calendar'[Date]),-12,MONTH))``````

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

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

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors