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
AltGr9
Helper I
Helper I

Return Top Result in Matrix using DAX

Hi I have a table of data that looks like this:

 

TopSite Data.PNG

 

And when I put it into a Matrix it looks like this:

 

TopSite Matrix 2.PNG

And what I'm looking for is a Matrix that looks like this:

 

TopSite Desired Result.PNG

 

I've tried various things in the .pbix attached but none of them work.

 

I'd like to achieve it using DAX if possible, so that I can add to it in future. Can you help?

 

Thanks in advance.

 

https://infinis-my.sharepoint.com/:u:/p/john_altamura/ERe8yEjSdkFLo5h3NbtwcmkBIHXqZiBnw05Qsr__C65-9w...

 

 

1 ACCEPTED SOLUTION
DimaMD
Solution Sage
Solution Sage

Hi @AltGr9 
Add the Class_new and Row Header columns to the data table

Class_new = 
SWITCH(
    TRUE(),
    [Class] = "Class 1", "Class A",
    [Class] = "Class 2", "Class B",
    [Class] = "Class 3", "Class C")
---------------------------------------
Row Header = "Top Site"


Follow these steps

Тop Site = 
VAR _maxdate =
    CALCULATE ( MAX ( 'Data'[Amount] ), ALLEXCEPT ( 'Data', 'Data'[Class_new] ) )
RETURN
    CALCULATE (
        MAX ( 'Data'[Site] ),
        FILTER (
            'Data',
            'Data'[Class] = MAX ( 'Data'[Class] )
                && 'Data'[Amount] = _maxdate
        )
    )

Screenshot_11.jpg


__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com

View solution in original post

2 REPLIES 2
tamerj1
Super User
Super User

Hi @AltGr9 

Try

Top Site =
MAXX ( FILTER ( TableName, TableName[Amont]=MAX(TableName[Amont]), TableName[Site])

 

please make sure to enable "Values on rows"

DimaMD
Solution Sage
Solution Sage

Hi @AltGr9 
Add the Class_new and Row Header columns to the data table

Class_new = 
SWITCH(
    TRUE(),
    [Class] = "Class 1", "Class A",
    [Class] = "Class 2", "Class B",
    [Class] = "Class 3", "Class C")
---------------------------------------
Row Header = "Top Site"


Follow these steps

Тop Site = 
VAR _maxdate =
    CALCULATE ( MAX ( 'Data'[Amount] ), ALLEXCEPT ( 'Data', 'Data'[Class_new] ) )
RETURN
    CALCULATE (
        MAX ( 'Data'[Site] ),
        FILTER (
            'Data',
            'Data'[Class] = MAX ( 'Data'[Class] )
                && 'Data'[Amount] = _maxdate
        )
    )

Screenshot_11.jpg


__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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