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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Return a value depending on a max value in another column

Hi,

I am looking at some data regarding earthquakes. I can return the highest Magnitude for the selections made, e.g. 8,2 in magnitude. What I want is to also retrieve the date for when it happened, and the region. So, if I select the month of July and the highest recorded magnitude was outside Japan on 2021-08-12, how can I get that value on a card? Looks like I am not using the correct DAX! Data looks as in the image below, thanks!

jarilomkm_0-1630667196745.png

 

Kind regards,

Jari

1 ACCEPTED SOLUTION
Jos_Woolley
Solution Sage
Solution Sage

Hi,

Date/Region Highest Magnitude =
VAR MyTable =
    ADDCOLUMNS (
        'Table 1',
        "Concat",
            'Table 1'[Date] & "|" & 'Table 1'[Region Name]
    )
RETURN
    MAXX (
        MyTable,
        IF ( 'Table 1'[Magnitude] = MAX ( 'Table 1'[Magnitude] ), [Concat] )
    )

Regards

View solution in original post

2 REPLIES 2
Jos_Woolley
Solution Sage
Solution Sage

Hi,

Date/Region Highest Magnitude =
VAR MyTable =
    ADDCOLUMNS (
        'Table 1',
        "Concat",
            'Table 1'[Date] & "|" & 'Table 1'[Region Name]
    )
RETURN
    MAXX (
        MyTable,
        IF ( 'Table 1'[Magnitude] = MAX ( 'Table 1'[Magnitude] ), [Concat] )
    )

Regards

Anonymous
Not applicable

Thank you, it works well with minor changes since it was supposed to be split!

 

Kind regards,

Jari

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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