Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Get the max value from Group

I have created measure like that to get MAX Value From Summarized Colum     The Problem is that when I try to display result of this measure in Matrix Visualization error shows up:   ...
  • mahoneypat's avatar
    4 years ago

    You need to use ADDCOLUMNS(SUMMARIZE(... instead of SUMMARIZECOLUMNS(...

     

    Max Value =
    VAR SummarizedTable =
        ADDCOLUMNS (
            SUMMARIZE (
                'Level 1 Metrics',
                'Level 1 Metrics'[Type],
                'Level 1 Metrics'[Metric Name],
                'Level 1 Metrics'[Date]
            ),
            "Total Value"CALCULATE ( SUM ( 'Level 1 Metrics'[Value] ) )
        )
    RETURN
        IF (
            ISFILTERED ( 'Level 1 Metrics'[Commercial Area] ),
            MAX ( 'Level 1 Metrics'[Value] ),
            MAXX ( SummarizedTable, [Total Value] )
        )

     

    Pat