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 again,
still struggling with the average of a measure.
I solved the issue above by creating a table instead of working with measures. This is working fine for the total values (aggregate of all the companies). But I still want to do it without the additional table.
This is how the average is calculated in the case where DOI is a column:
The Average is calculated as follows:
This is the calculation in the case where DOI is a measure:
The both tables below show the results for both cases. How can I get the results of the left table using the measure? Thanks!