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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Leon12Smith
Frequent Visitor

Top N for graph with 2x hierarchy data fields

Hi

I have a table called Vehicles - it contains a hierarchy field "Make and Model" of vehicles showing the vehicles "Model" and specific connected "Make":

Leon12Smith_0-1684755018606.png


I am plotting a Column Chart with this mentioned field as the x-axis with a calculated measure on the y-axis - call it "y_axis_measure".

Leon12Smith_1-1684755128999.png


I want to filter the graph to only show the top 10 "Make and Model" vehicles by the "y_axis_measure". But I do not have this option available on the Filters pane. 

I can only filter by either Vehicle[Make] or Vehicle[Model]:

Leon12Smith_2-1684755385436.png


Can I create a measure or filter to only show the top 10 Vehicles Make and Model by the "y_axis_measure"? In other words, the top 10 "y_axis_measure" values of the Vehicles in the Vehicles table based on the combination of the Make and Model description.

Thanks

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Leon12Smith , Try like this examples

 

2 column top N = CALCULATE([Net], TOPN(10, SUMMARIZE(ALLSELECTED('Item'), 'Item'[make], 'Item'[model]), [Net],DESC),VALUES('Item'[Make]), VALUES('Item'[model]) )

 


2 column top N = Sumx(Keepfilters( TOPN(10, SUMMARIZE(ALLSELECTED('Item'), 'Item'[make], 'Item'[Model]), [Your measure],DESC)), [Your measure])

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Share some data to work with and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@Leon12Smith , Try like this examples

 

2 column top N = CALCULATE([Net], TOPN(10, SUMMARIZE(ALLSELECTED('Item'), 'Item'[make], 'Item'[model]), [Net],DESC),VALUES('Item'[Make]), VALUES('Item'[model]) )

 


2 column top N = Sumx(Keepfilters( TOPN(10, SUMMARIZE(ALLSELECTED('Item'), 'Item'[make], 'Item'[Model]), [Your measure],DESC)), [Your measure])

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.