Reputation: 167
Looking for some DAX guidance here, to return a text field based on the maximum returned by a measure appplied over that column.
i.e we have table[category_column] and [measure] and the measure references columns in other tables, with two-sided relationships.
Any help much appreciated, very stuck!
Thanks in advance
Upvotes: 1
Views: 12123
Reputation: 46
If I'm reading right, I think you want to draw the measure against the column values and return the row with the max of the measure. Something like this?
newMeasure =
VAR vals = SUMMARIZE('Table', 'Table'[Column1], "myMeasure", [Measure])
VAR measureMax = MAXX(vals, [myMeasure])
VAR value = CALCULATE(MAXX(FILTER(vals, [myMeasure] = measureMax), [Column1]))
RETURN
value
Upvotes: 2
Reputation: 2584
If your column to be used for max is Column1 and your text field is Column2 something like the below could work:
Measure =
VAR Max_Value =max('Table'[Column1])
Return CALCULATE(MAX('Table'[column2]),'Table'[Column1]=Max_value)
If this is not what you are looking for you have to explain your requirements in further detail, hopefully with examples.
Upvotes: 0