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! Request now

Reply
ryan_b_fiting
Post Patron
Post Patron

Matrix to show Top item only - Text

Hello Community - 

 

I am looking to create a matrix visual that will show me the Top 1 item by each day and hour of the day.  I want the values to be text so that it shows me based on the day and hour intersection what are the users favorite drinks.  I have a table that contains the below data (favorite drink is from a users table joined to this table on user id).

 

GeoFence Table.PNG

 

I want to take this data and baseed on the number of visits (Row count of the above table) I want to show the top ranked favorite drink by day and hour of visit time.  So I would like my matrix to be similar to the one below, but instead of the counts I want to show the text for the Top ranked drink caregory:

Matrix.PNG

 

I am thinking I have to do some sort of SUMMARIZE and RANKX function and then set the filter on the visual to RANK =1.  But I cannot figure it out nor can I get the correct output.  I seem to always just get the first (alphabetically) favorite drink on that day and time visisted.

 

Any help on this would be great.  I have been spinning my wheels for a while trying to figure this out.

 

Thanks Community!

Ryan F

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

You could just do a MAXX over a SUMMARIZE with a COUNTROWS in it to get your maximum amount of rows for a product. Then just do a MAXX over a FILTER of that same SUMMARIZE table to get the drink that corresponds to that maximum. You post has a lot of words that I didn't read but something like:

 

Measure =

VAR __Table =

  SUMMARIZE(

    'Table',

    [Favorite drink],

    "Count",COUNTROWS('Table')

  )

VAR __Max = MAXX(__Table,[Count])

VAR __Favorite = MAXX(FILTER(__Table,[Count] = __Max),[Favorite Drink])

RETURN

__Favorite

 

It is kind of like https://community.powerbi.com/t5/Quick-Measures-Gallery/Lookup-Min-Max/td-p/985814



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

You could just do a MAXX over a SUMMARIZE with a COUNTROWS in it to get your maximum amount of rows for a product. Then just do a MAXX over a FILTER of that same SUMMARIZE table to get the drink that corresponds to that maximum. You post has a lot of words that I didn't read but something like:

 

Measure =

VAR __Table =

  SUMMARIZE(

    'Table',

    [Favorite drink],

    "Count",COUNTROWS('Table')

  )

VAR __Max = MAXX(__Table,[Count])

VAR __Favorite = MAXX(FILTER(__Table,[Count] = __Max),[Favorite Drink])

RETURN

__Favorite

 

It is kind of like https://community.powerbi.com/t5/Quick-Measures-Gallery/Lookup-Min-Max/td-p/985814



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Decklerworked just as needed.  Thanks for the quick answer!

Great! 🙂


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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