Forum Discussion
Calculating quarterly historical average
- Anonymous3 years ago
Hi mgarcianxp ,
I suggest you to try to create a CALENDAR table to help calculation.
Calendar = ADDCOLUMNS ( CALENDARAUTO (), "Year", YEAR ( [Date] ), "Quarter", QUARTER ( [Date] ), "Month", MONTH ( [Date] ) )Create a relationship between 'Calendar'[Date] and 'Fact Table'[Date].
AVERAGE BY QUARTER = AVERAGEX ( ALLEXCEPT ( Calendar, Calendar[Year], Calendar[Quarter] ), 'Fact Table'[DIO] )If this reply still couldn't help you solve your issue, please share a sample file with me.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi mgarcianxp ,
I suggest you to try to create a CALENDAR table to help calculation.
Calendar =
ADDCOLUMNS (
CALENDARAUTO (),
"Year", YEAR ( [Date] ),
"Quarter", QUARTER ( [Date] ),
"Month", MONTH ( [Date] )
)
Create a relationship between 'Calendar'[Date] and 'Fact Table'[Date].
AVERAGE BY QUARTER =
AVERAGEX (
ALLEXCEPT ( Calendar, Calendar[Year], Calendar[Quarter] ),
'Fact Table'[DIO]
)
If this reply still couldn't help you solve your issue, please share a sample file with me.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I reworked my solution and used your proposal, as mine was less elegant 😉 thanks!