March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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!!!
Solved! Go to 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
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 ?
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!!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
125 | |
81 | |
63 | |
54 | |
42 |
User | Count |
---|---|
194 | |
106 | |
90 | |
63 | |
51 |