Forum Discussion

Lucy01's avatar
Lucy01
Helper I
7 months ago
Solved

Create Measure to Return Highest Value

I’m trying to create a measure that returns the highest result out of three options.   For example, I want to create a trendline for student attendance and the three options are Above Average, Aver...
  • ryan_mayu's avatar
    ryan_mayu
    7 months ago

    Lucy01 

    you can try this

     

    Classwork Max Result =
    CALCULATE(
    MAX('Sheet1'[Value]),
    ALLEXCEPT('Sheet1', 'Sheet1'[Month])
    )

     

    Classwork Max Category =
    VAR tbl =
    ADDCOLUMNS(
    {
    ( "Above Average", [Classwork Above Average] ),
    ( "Average", [Classwork Average] ),
    ( "Below Average", [Classwork Below Average] )
    },
    "Category", [Value]
    )
    VAR MaxVal = MAXX(tbl, [Value])
    RETURN
    SELECTCOLUMNS(
    FILTER(tbl, [Value] = MaxVal),
    "Category", [Category]
    )

     

    Are these three average data measures or columns? It's better to provide some sample data