I'm trying to write a DAX function to find the maximum value in one column based on a condition in another, but have this condition change dynamically based on the row value.
With this code:
CALCULATE(MAX(RankOfArea[count]),filter(RankOfArea,RankOfArea[Line]="Pic"))
I get this table:
count | Line | Max
7220 | Pic | 7220
283 | Dis | 7220
3557 | Pic | 7220
317 | Met | 7220
500 | Met | 7220
And I'd like this result:
count | Line | Max
7220 | Pic | 7220
283 | Dis | 283
3557 | Pic | 7220
317 | Met | 500
500 | Met | 500
Of course I have to remove the ="Pic", but not sure what to replace it with? Many thanks