Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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

M1Max value
M2MAX value
M3MAX value
M4MAXVALUE

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

NewUser_PowerBI_0-1640161037754.png

 

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:

 T1T2T3T4
M110208040
M2100200500150
M3250250250250

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

     
M180T3  
M2500T3  
M3250T1,T2,T3,T4  
1 ACCEPTED SOLUTION
v-janeyg-msft
Community Support
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],
        ","
    )

vjaneygmsft_0-1641463888331.png

 

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

View solution in original post

3 REPLIES 3
v-janeyg-msft
Community Support
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],
        ","
    )

vjaneygmsft_0-1641463888331.png

 

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
Anonymous
Not applicable

@amitchandak : due to data sensvity i cannot share the screenshots or PBI file

amitchandak
Super User
Super User

@Anonymous ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.