Forum Discussion
How find a column name from MAX value
Hello Experts,
I need a dax formula to find the column name corresponding to the Measure which calculates Max value.
I have a Matrix visualization which displays All the max values, and the max value changes as per the team selected in slicer, the measures are from diffrentables, but shown under single matrix visual
| M1 | Max value |
| M2 | MAX value |
| M3 | MAX value |
| M4 | MAXVALUE |
ISSUE:I want a Dax formula to show the Max value of all the Teams and team name to be displayed in the matrix, the complexity is measure value and the teams are not directly related tables in the model, they are indirectly related(M-M) join
Maxvalue dax:var smry = SUMMARIZE('DIMTABLE','DIMTABLE'[D1],'DIMTABLE'[D2], "Measure Value", [FCT_TABLE_MSR])
return
maxx(smry, [Measure Value])
Present matrix in power bI:
| T1 | T2 | T3 | T4 | |
| M1 | 10 | 20 | 80 | 40 |
| M2 | 100 | 200 | 500 | 150 |
| M3 | 250 | 250 | 250 | 250 |
I need a dax to return the Maxvalue dax associated DIMTABLE'[D2], i tried calulate ,All, Allexcept with no luck.. can ypu please suggest?
O/P needed
| M1 | 80 | T3 | ||
| M2 | 500 | T3 | ||
| M3 | 250 | T1,T2,T3,T4 |
Hi, Anonymous
You can try like this:
Measure = VAR maxvalue = MAXX ( FILTER ( ALL ( 'Table' ), [M] = SELECTEDVALUE ( 'Table'[M] ) ), [Value] ) RETURN CONCATENATEX ( FILTER ( ALL ( 'Table' ), [M] = SELECTEDVALUE ( 'Table'[M] ) && [Value] = maxvalue ), [Attribute], "," )Did I answer your question ? Please mark my reply as solution. Thank you very much.If not, please feel free to ask me.Best Regards,Community Support Team _ Janey
3 Replies
- amitchandak
Super User
Anonymous ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
- AnonymousNot applicable
amitchandak : due to data sensvity i cannot share the screenshots or PBI file
- v-janeyg-msft
Community Support
Hi, Anonymous
You can try like this:
Measure = VAR maxvalue = MAXX ( FILTER ( ALL ( 'Table' ), [M] = SELECTEDVALUE ( 'Table'[M] ) ), [Value] ) RETURN CONCATENATEX ( FILTER ( ALL ( 'Table' ), [M] = SELECTEDVALUE ( 'Table'[M] ) && [Value] = maxvalue ), [Attribute], "," )Did I answer your question ? Please mark my reply as solution. Thank you very much.If not, please feel free to ask me.Best Regards,Community Support Team _ Janey