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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Lookup value that another value on same row is max

Dear friends

how can i lookup type from table1 that have max value for each name in table 2

for example

Table 1

NameTypeValue
Jame      A    10
Jame      B    20
John     C    5
John     D    15

 

Table2

NameType
Jame     B
John     D

i need to show type that have max value for each name

thank you in advance for any suggestion.

1 ACCEPTED SOLUTION
v-angzheng-msft
Community Support
Community Support

Hi, @username

Try to create a calculate column below:

_COL =
VAR _MAXValue =
    MAXX (
        FILTER ( 'Table', 'Table'[Name] = EARLIER ( 'Table'[name] ) ),
        'Table'[Value]
    )
RETURN
    IF ( 'Table'[Value] = _MAXValue, 'Table'[Type], BLANK () )

If you want to summarize in another table you can create a calculate table using the following formula:

Table2 =
VAR _maxValue =
    SELECTCOLUMNS (
        'Table',
        "1", CALCULATE ( MAX ( 'Table'[Value] ), ALLEXCEPT ( 'Table', 'Table'[Name] ) )
    )
RETURN
    SUMMARIZE ( FILTER ( 'Table', [Value] IN _maxValue ), [Name], [Type] )

I created a simple sample to illustrate this.

Sample:

v-angzheng-msft_0-1619756233253.png

Result:

v-angzheng-msft_1-1619756233256.jpeg

Table2:

v-angzheng-msft_2-1619756233257.png

Please refer to the attachment below for details

 

 

Is this the result you want? Hope this is useful to you

Please feel free to let me know If you have further questions

 

Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

5 REPLIES 5
v-angzheng-msft
Community Support
Community Support

Hi, @username

Try to create a calculate column below:

_COL =
VAR _MAXValue =
    MAXX (
        FILTER ( 'Table', 'Table'[Name] = EARLIER ( 'Table'[name] ) ),
        'Table'[Value]
    )
RETURN
    IF ( 'Table'[Value] = _MAXValue, 'Table'[Type], BLANK () )

If you want to summarize in another table you can create a calculate table using the following formula:

Table2 =
VAR _maxValue =
    SELECTCOLUMNS (
        'Table',
        "1", CALCULATE ( MAX ( 'Table'[Value] ), ALLEXCEPT ( 'Table', 'Table'[Name] ) )
    )
RETURN
    SUMMARIZE ( FILTER ( 'Table', [Value] IN _maxValue ), [Name], [Type] )

I created a simple sample to illustrate this.

Sample:

v-angzheng-msft_0-1619756233253.png

Result:

v-angzheng-msft_1-1619756233256.jpeg

Table2:

v-angzheng-msft_2-1619756233257.png

Please refer to the attachment below for details

 

 

Is this the result you want? Hope this is useful to you

Please feel free to let me know If you have further questions

 

Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

amitchandak
Super User
Super User

@Anonymous , is table 2 is what you need ?

or what is the expected output

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak Type column from table 1 for each name that have max value on value column

@Anonymous , Not sure I got it correctly. Like 

 

maxx(filter(Table1, [Name] =earlier([name])), [Value])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak from your formular result is value  but i need to show type

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors