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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Woodyy
Regular Visitor

Need help with YTD moving average

Hi everybody, 

 

I am trying to compute the YTD moving average for the product A for 2023 and 2024. The date is in the same column both for 2023 and 2024 and 
I would like to eventually obtain a YTD column where it starts the average computation again from 0 in january 2024, without taking into account also the 2023 values( as it instead does in the rapid measure)

 

How can i solve it?

thank you!!! 

1 ACCEPTED SOLUTION

Hello, @Woodyy ,
as long as you have Date type in one of the columns in your calendar (with relationship to your fact table) and you use that calendar inside the expressions, it's going to work just fine.

 

Please test and mark the right answer as a solution, possibly some kudos would be also appreciated. Thank you

View solution in original post

7 REPLIES 7
vojtechsima
Super User
Super User

Hello, @Woodyy ,
you can try using TOTALYTD.

Measure = TOTALYTD(<your expression>, 'Calendar'[Date]) 
-- make sure you have valid Calendar for this.

Dear @vojtechsima , thank you for the reply! 
How do I compute the moving average in this case ? 

@Woodyy 

vojtechsima_0-1730748714282.png

avg = AVERAGE('Table'[value])
avgRunning = TOTALYTD([avg], 'calendar'[Date])


given you have the calendar

 

Thank you so much @vojtechsima , it is very clear now! 
i have a date column ( in the date format) with years and months. Does it work anyway or do I need to change it to the right format? And if yes, how can I do it? 
thank you again! 

Thank you so much @vojtechsima, it is very clear! 
I have a column with the date ( in the date format) with years and months. Does it work anyway or do i need to create another column in that specific way? And, in case , how can I convert my date column in the right format? 

thank you again! 

Hello, @Woodyy ,
as long as you have Date type in one of the columns in your calendar (with relationship to your fact table) and you use that calendar inside the expressions, it's going to work just fine.

 

Please test and mark the right answer as a solution, possibly some kudos would be also appreciated. Thank you

Dear @vojtechsima , thank you again! 
i have tried your solution but unfortunately it does not work because I forgot to mention that I would compute the average of a measure( this measure simply computes the rate between two values) and the AVERAGE function does not recognizes the measures. 
How can i fix it? 

thank you so much!!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors