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
Anonymous
Not applicable

Moving Average for custom calendar

Hey everyone, 

 

I have  a custom calendar so the moving average calculations I have tried aren't working, namely the DATESINPERIOD function. My Calendar periods are 28 days each and the financial year begins on the 1/04/17 for eg. Is there a way I can use the DATESINPERIOD function and format it to begin at the start of my financial year, or is there any other way around calculating moving average for a custom calendar.

 

Thank you in advance 

 

Regards,

 

Pangea

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @Anonymous,

 



Is there a way I can use the DATESINPERIOD function and format it to begin at the start of my financial year.

 


I'm afraid this is not available. Such a time intelligence function works based on natural calendar dates, instead of custom calendar.

 



or is there any other way around calculating moving average for a custom calendar.

 


For more advice, please provide sample data to tell us what the data table is, what the custom calendar looks like and how to calculate the moving average. Besides, please show us your desired output with examples. How to Get Your Question Answered Quickly

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
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

2 REPLIES 2
v-yulgu-msft
Employee
Employee

Hi @Anonymous,

 



Is there a way I can use the DATESINPERIOD function and format it to begin at the start of my financial year.

 


I'm afraid this is not available. Such a time intelligence function works based on natural calendar dates, instead of custom calendar.

 



or is there any other way around calculating moving average for a custom calendar.

 


For more advice, please provide sample data to tell us what the data table is, what the custom calendar looks like and how to calculate the moving average. Besides, please show us your desired output with examples. How to Get Your Question Answered Quickly

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

I solved it, thanks for your prompt reply though

 

In case anyone else needs a pointer in how to achieve this;

 

Index your months in your calendar table 

 

and then filter using your calendar date table and calendar index column

 

max<= (x) - how many steps, or months, [n-1) logic, so for 3 months = max <= -2 and for 12 months = max<= -11

 

Then create a new measure, which will allow you to divide by the periods you have, so eg, in  12 month Fiscal Year, I have 13 periods, so I use my index measurement and divide it by 13 periods

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.