Forum Discussion
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!!!
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
7 Replies
- vojtechsima
Super User
Hello, Woodyy ,
you can try using TOTALYTD.Measure = TOTALYTD(<your expression>, 'Calendar'[Date]) -- make sure you have valid Calendar for this.- WoodyyRegular Visitor
Dear vojtechsima , thank you for the reply!
How do I compute the moving average in this case ?- vojtechsima
Super User
avg = AVERAGE('Table'[value])avgRunning = TOTALYTD([avg], 'calendar'[Date])
given you have the calendar