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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
reiff
New Member

Return the count of a max value of a category with multiple filters

In a measure I want to return the max value product from a given time period and geography, and then count those across the entire table. Below is an example table, but each region has a max result across each year in the table. Thank you in advance, having trouble isolating the filters to apply correctly to find the max product.

Prodcut NameNumberYearRegion
Product1382442021South-east
Product297892021South-east
Product360102021South-east
Product4337532021South-east
Product528092021South-east
Product669752021South-east
Product1171152003North-west
Product295652003North-west
Product3176612003North-west
Product4213842003North-west
Product559492003North-west
Product1151562016Central
Product295882016Central
Product393452016Central
Product4159002016Central
Product5255182016Central
Product694092016Central


For 2021 in the South-east it should return Product1 as the highest number (38244)
For 2003 in the North-west it should return Product4 as the highest number (21384)
For 2016 in Central it should return Product5 as the highest number (25518)
etc.

Result would be something like this:

YearProduct1Product2Product3Product4Product5Product6
2021100000
2016000010
2003000100



1 REPLY 1
amitchandak
Super User
Super User

@reiff , if name same as index 1 order by measure partition by year

 

Power BI Index function: Top/Bottom Performer by name and value- https://youtu.be/HPhzzCwe10U

 

example

if ( max( 'Item'[Brand]) =

maxx( index(1,SUMMARIZE(ALLSELECTED(sales), 'Item'[Brand], "_net",[Net]),ORDERBY([_net],DESC)),[Brand]),1,0)
 
Use product and your measure in this
Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.