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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Top N products by highest score

Hello!

 

I have a table with products and their rating score, like this:

BobBnks_0-1666625202322.png

 

I want to show the top 10 products according to their highest score.

 

I am struggling to find the correct dax that will return me the highest score for each distinct product, and then use it in a visualisation. Top N doesn't show the top 10 products either, it will only arrange the full Product list in to descending order when used in a visualisation.


Does anyone know the simplest way to do this?

 

Thank you in advance.

1 ACCEPTED SOLUTION
v-yadongf-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please create a new column:

RANK = RANKX('Table',[Sore],,DESC,Skip)

vyadongfmsft_0-1666861657957.png

 

Create a table and put RANK field into filters, you can show the top 10 products according to their highest score.

vyadongfmsft_1-1666861698562.png

 

Best regards,

Yadong Fang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yadongf-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please create a new column:

RANK = RANKX('Table',[Sore],,DESC,Skip)

vyadongfmsft_0-1666861657957.png

 

Create a table and put RANK field into filters, you can show the top 10 products according to their highest score.

vyadongfmsft_1-1666861698562.png

 

Best regards,

Yadong Fang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

eliasayy
Impactful Individual
Impactful Individual

Hello, 
first start by created the max measure:

max of eac prodcut = CALCULATE(MAX(Bob[Score]),ALLEXCEPT(Bob,Bob[Product]))

now you have to rank your scores:

ranking based on max = RANKX(ALL(Bob[Product]),[max of eac prodcut],,DESC,SKIP)

and to pick your top 10 :

Top 10 products = CALCULATE([max of eac prodcut],FILTER(Bob,[ranking based on max]<=10))

 

or just go to filters,add filetrs topn and put the max of each product measure as values 

johnt75
Super User
Super User

Create a measure like

Highest score = MAX( 'Table'[Score])

you can then put that into a table visual with the product and use it as a TOPN filter in the filter pane

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Top Kudoed Authors