Forum Discussion

RodoFliess's avatar
RodoFliess
Copper Contributor
Feb 17, 2023
Solved

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...
  • SergeiBaklan's avatar
    SergeiBaklan
    Feb 18, 2023

    RodoFliess 

    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 )
        )
    )
    

     

Resources