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

Helper V

## Rolling 12 month calculation - Not all 12 months showing in table

Afternoon all

Can someone please help with the following calculations. I'm trying to work out how to do a rolling 12 month calculation

My starting point will always need to go back 12 month even though the previous 12 months arent showing in the table (if that makes sense), So my starting point above is Nov and for that calculation I would need to sum the previous 12 months figures and then so on for each month showing in the table, and then deivide each rolling period by 12 to get the average rolling figure for that month. So

for Nov 20 - Sum the figures for Dec 19 - Nov 20 and divide that by 12

Dec 20 - Sum the figures for Jan 20 - Dec 20 and divide that by 12

Jan 21 - Sum the figures for Feb 20 - Jan 21 and divide that by 12

And so on

I then only want to see the previous 12 months in the table

I then need to do the same measure but with a different field, but once I have the measure for the abbove I can easily do this. Then finally I would didide one measure by the other to get the below final table %'s

Essentially my final table will look like the below

Is there anyone that can help with the rolling calculation please. I really hope the above makes some sense?

Karen

1 ACCEPTED SOLUTION
Memorable Member

CALCULATE(Measure),
DATESINPERIOD('Sales Table'[Docket Date], LASTDATE('Sales Table'[Docket Date]), -365, DAY))

Hope this helps.

3 REPLIES 3
Memorable Member

CALCULATE(Measure),
DATESINPERIOD('Sales Table'[Docket Date], LASTDATE('Sales Table'[Docket Date]), -365, DAY))

Hope this helps.

Helper V

Hi @davehus

Thanks so much for getting back to me. This is great, think it's done the trick and I can use for my other measure too, which is ace 😊  . Will do a bit more testing and then come back and sign off as solution

Kind regards

Karen

Memorable Member

Thanks @KarenFingerhut , Glad I could be of help. 🙂

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