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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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