Forum Discussion
RodoFliess
Feb 17, 2023Copper Contributor
Data Model Pivot Table Average Subtotals
Hello Everyone, I´m having an issue witha a pivot table from the data model. I want the quarterly subtotals to show monthly average rather than sum, but the option is grayed out: Is there...
- Feb 18, 2023
For such sample
measure could be
Total:=IF ( HASONEVALUE ( tbl[Date (Month)] ), SUM ( tbl[Value] ), AVERAGEX ( VALUES ( tbl[Date (Month)] ), DIVIDE ( SUM ( tbl[Value] ), COUNTROWS ( VALUES ( tbl[Date (Month)] ) ), 0 ) ) )
SergeiBaklan
Feb 17, 2023Diamond Contributor
If you are on data model I'd recommend not to use implicit measures at all. Create your own DAX explicit measures with SUM, AVERAGE, whatever and use them in PivotTable.
RodoFliess
Feb 17, 2023Copper Contributor
SergeiBaklan
Thanks for your reply!
I´m not very good with DAX measures, how could I create a measure that sums by month and then shows quarter monthly average?
Thanks!
- SergeiBaklanFeb 18, 2023Diamond Contributor
For such sample
measure could be
Total:=IF ( HASONEVALUE ( tbl[Date (Month)] ), SUM ( tbl[Value] ), AVERAGEX ( VALUES ( tbl[Date (Month)] ), DIVIDE ( SUM ( tbl[Value] ), COUNTROWS ( VALUES ( tbl[Date (Month)] ) ), 0 ) ) )
- RodoFliessFeb 22, 2023Copper ContributorThank you so much! This is exactly what I needed!
- SergeiBaklanMar 01, 2023Diamond Contributor
You are welcome, glad to help
- JosWoolleyFeb 18, 2023Iron Contributor
If you post a very small, copiable dataset together with expected results I can show you the necessary measures.
Regards- RodoFliessFeb 22, 2023Copper ContributorThe code Sergei posted solved my problem already, but thank you very much for your offer!