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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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