Forum Discussion

Ababneh's avatar
Ababneh
Frequent Visitor
8 years ago
Solved

Rank one by one

Hey all, I'm a new user to Power BI, but I learn fast, I only need guidance here what to look for. I have a table like this: Name ID Score Times Tried Michael 3167 44 5 James 3142...
  • chethan's avatar
    8 years ago

     

    Ababneh

    Follow the below steps

    Create 2 Mesures

     

     

    Scores = CALCULATE(SUM(Table1[Score]))

    Then Rank Measures

     

     

    Ranking = RANKX ( ALL ( Table1[Name]), [Scores],,DESC,Dense)

     

    to Filter top 5 use this measure

     

     

    Top 5 Name = 
    IF( HASONEVALUE( 'Table1'[Name]) ,
    	IF ( 
    	[Ranking] <= 5 ,
    		[Ranking] , 
    			BLANK()
    	)
    )

     

    & filter it as "is not Blank" from visual level filters

     

    Regards,

    Chetan K

     

     

  • v-jiascu-msft's avatar
    8 years ago

    Hi Ababneh,

     

    I think the column ID is unique though there are duplicates 3142. And the ID should be unique. If so, it's easy to find the top 5.

    1. In Query Editor, sort "Score" by Desc and sort "Times Tried" by Asc;

    2. Add an index from 1 and change the column into "Order". Then the rank is ready;

    3. Set ID sort by "Order";

    4. Create a visual "Funnel" and set field as the picture showed. 

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    Best Regards!

    Dale