Forum Discussion

matteocarnelos's avatar
matteocarnelos
Advocate III
8 years ago
Solved

Totals in Matrix Table

Hi guys,   this may be a stupid question but I can't find the answer.   Can I modify the formula of the Total in a matrix table?   I try to explain better with an example.   These are my data...
  • Stachu's avatar
    8 years ago

    I think you need to specify the sum yourself, e.g.:

    AvgThenSum =
    VAR Avg_Basic =
        AVERAGE ( Table1[Value] )
    VAR Sum_Avg_Cat =
        SUMX (
            ADDCOLUMNS (
                SUMMARIZE ( Table1, Table1[Category] ),
                "AvgPerCat", CALCULATE ( AVERAGE ( Table1[Value] ) )
            ),
            [AvgPerCat]
        )
    RETURN
        IF ( HASONEVALUE ( Table1[Year] ), Avg_Basic, Sum_Avg_Cat )