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
madeline
Frequent Visitor

Get a column's value(s) based on another column's max

In my table, I have a calculated column (NumFailedLogins) which shows the number of times a user appears based off of a condition. Now, I want to get a value from another column (User) based off of the max from the calculated column (NumFailedLogins). There is a possibility of multiple users having the same max value, but I only need to return at least one of them.

UserNumFailedLogins
Mary3
Mary3
Mary3
Frank2
Jane0
Frank2
Frank2
John3
John3
John3
Frank2

 

In the above example, I would like to return either Mary or John (or both if that's even possible. If not, it's fine). 

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@madeline

 

You could use this measure

File attached as well

 

Measure =
CONCATENATEX (
    CALCULATETABLE (
        VALUES ( Table1[User] ),
        FILTER ( Table1, Table1[NumFailedLogins] = MAX ( Table1[NumFailedLogins] ) )
    ),
    Table1[User],
    ", "
)

 


Regards
Zubair

Please try my custom visuals

View solution in original post

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

@madeline

 

You could use this measure

File attached as well

 

Measure =
CONCATENATEX (
    CALCULATETABLE (
        VALUES ( Table1[User] ),
        FILTER ( Table1, Table1[NumFailedLogins] = MAX ( Table1[NumFailedLogins] ) )
    ),
    Table1[User],
    ", "
)

 


Regards
Zubair

Please try my custom visuals

This is awesome, thanks!

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.