Forum Discussion
jopezzo
Helper I
7 years agoHow to filter a table based on a column's highest value
Hi, I am trying to calculate the total quantity by Quality from a table called "Data", but filtering on the highest value in Period (in this case, 201906). The purpose is to calculate the varian...
- Anonymous7 years agoPlease use the same link as above.
Best
D.
Greg_Deckler
Community Champion
7 years agoCreate a DAX formula that goes something like this:
Measure IsHighest =
VAR __table = SUMMARIZE(ALLSELECTED('Table'),[Quality], [Period],"__Quantity",SUM([Quantity]))
VAR __max = MAXX(__table,[__Quantity])
VAR __period = MAXX(FILTER(__table,[__Quantity] = __max),[Period])
RETURN
IF(MAX([Period]) = __period,1,0)
Then just fiilter on this being 1