Forum Discussion
Create Measure to Return Highest Value
- 7 months ago
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
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
Thank you, the averages are all measures. Would I be better off using columns?
Please find sample data attached, thank you