Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

do a top 10 on a table visual?

I have a typical model, with my Project and Fact dimensions.

 

In my visual I am showing: ‘Project’[Manager] and a Hours measure from the Fact.

 

The visual works fine:

 

But it shows hundres of rows, and I wanted just the top 10. 

 

Ideally I was planning to show the top 10 in a pie chart and group all the other hours as Others. Sort of like this:

 

 

How can I achieve this? And if so… do I need to replace the manager or hours column?

 

(I looked in the table visual and pie chart visual properties but it doesnt have a 'top' property)

 

 

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous ,

     

    According to your statement, I think there are two questions in your post. One is how to use Top N in table visual and another is how to show managers in “other” group which are out of Top N range.

     

    1. As other users mention you can use Top N function in filter field. Use Top N and add [Hour] measure into By value field.

    2. "Other" group and managers should be legend in pie chart. So I suggest you to create a calculated column.

    New Legend = 
    VAR _RANK = RANKX(Project,[Hour],,DESC,Dense)
    RETURN 
    IF(_RANK <=10, Project[Manager],"Other")

    In my Sample, I show Top 3.

     

    Best Regards,
    Rico Zhou

     

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

     

     

4 Replies

  • Thennarasu_R's avatar
    Thennarasu_R
    Icon for Responsive Resident rankResponsive Resident

    Hi !
    Anonymous 
    You want only to 10 You can apply Visual level Filter.

    As per your requirements in to your Pie charts .
    You Should create a one new Calculated Column.

    Can you send any refference Pic for your requirements. i will do querry send to you.

    Thanks,
    Thennarasu

     

  • Have you tried  adding the filter option on the Power BI. I think this option might be able to give you the solution you are looking for. In here you can select the "Top N" and provide show Items as Top 10

     

     

    Hope this help

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    According to your statement, I think there are two questions in your post. One is how to use Top N in table visual and another is how to show managers in “other” group which are out of Top N range.

     

    1. As other users mention you can use Top N function in filter field. Use Top N and add [Hour] measure into By value field.

    2. "Other" group and managers should be legend in pie chart. So I suggest you to create a calculated column.

    New Legend = 
    VAR _RANK = RANKX(Project,[Hour],,DESC,Dense)
    RETURN 
    IF(_RANK <=10, Project[Manager],"Other")

    In my Sample, I show Top 3.

     

    Best Regards,
    Rico Zhou

     

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