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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

return max category

Does anyone know a dax expression i could use to show the max category in the screen shot below. For example, a row that shows brother for cosco,dad for walmart, and cousin for samsclub?

 

pbi question.PNG

1 ACCEPTED SOLUTION
edhans
Community Champion
Community Champion

See the attached file.

First I normalized your data with Power Query so it was more like a database.

image.png

Then I used the following measure:

Max Client Spending = 
VAR BigSpending = MAX(Receipts[Spending])
RETURN
CALCULATE(
    MAX(Receipts[Client]),
    FILTER(Receipts,[Max Spending] = BigSpending)
)

I also had a Max Spending measure that is referenced in the above, which is simply:

Max Spending = MAX(Receipts[Spending])

The end result is a table that looks like this, which shows the relative, their maximum spending amount, and where it was at.

 

image.png

 

The PBIX file is here.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

2 REPLIES 2
edhans
Community Champion
Community Champion

See the attached file.

First I normalized your data with Power Query so it was more like a database.

image.png

Then I used the following measure:

Max Client Spending = 
VAR BigSpending = MAX(Receipts[Spending])
RETURN
CALCULATE(
    MAX(Receipts[Client]),
    FILTER(Receipts,[Max Spending] = BigSpending)
)

I also had a Max Spending measure that is referenced in the above, which is simply:

Max Spending = MAX(Receipts[Spending])

The end result is a table that looks like this, which shows the relative, their maximum spending amount, and where it was at.

 

image.png

 

The PBIX file is here.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
TeigeGao
Solution Sage
Solution Sage

Hi @Anonymous ,

We can use the following DAX query:

Measure =
CALCULATE (
    MIN ( Table1[Client] ),
    FILTER (
        ALL ( Table1 ),
        Table1[data]
            = CALCULATE (
                MAX ( Table1[data] ),
                FILTER ( ALL ( Table1 ), Table1[People] = MIN ( Table1[People] ) )
            )
            && Table1[People] = MIN ( Table1[People] )
    )
)

The result will like below: 

PBIDesktop_o1GwsBROpy.png

Best Regards,

Teige

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.