cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

TOPN without Duplicate in Power BI

Hi Team,

Below my data but when select TOPN 5 its display duplicate also but I need only TOP 5 values

Current its display 7 bars but i need only 5 bars in chart(I need only top 5 Employees mean A,C,B,D,F)

 

NameNo
A10
B8
C9
D7
E7
F7
G7
H5
I4

 

wrong out my like(its display 7 bars i need only 5 bars)

TOPN.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Expected output:

I need only top 5 Employees mean A,C,B,D,F

 

 

1 ACCEPTED SOLUTION
Community Support
Community Support

Hi, @Shanvitha01 

According to your description, you want to show just 5 bars in the chart. I think you can add an index column in power query editor, you can follow my steps:

  1. Open power query editor, select the [NO] Column, and sort Descending, like this:

v-robertq-msft_0-1604041027707.png

 

  1. Add an index column:

v-robertq-msft_1-1604041027712.png

 

  1. Change the filter of this visual, like this:

555.png

 

And you can get what you want, like this:

777.png

 

You can download my test pbix file here

 

If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

How to Get Your Question Answered Quickly 

 

Best Regards,

Community Support Team _Robert Qin

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

2 REPLIES 2
Community Support
Community Support

Hi, @Shanvitha01 

According to your description, you want to show just 5 bars in the chart. I think you can add an index column in power query editor, you can follow my steps:

  1. Open power query editor, select the [NO] Column, and sort Descending, like this:

v-robertq-msft_0-1604041027707.png

 

  1. Add an index column:

v-robertq-msft_1-1604041027712.png

 

  1. Change the filter of this visual, like this:

555.png

 

And you can get what you want, like this:

777.png

 

You can download my test pbix file here

 

If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

How to Get Your Question Answered Quickly 

 

Best Regards,

Community Support Team _Robert Qin

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

Super User IV
Super User IV

@Shanvitha01 , Assumed No as measure.

 

rank = rankx(ALL(Table[Name]),[No],,desc,dense) + rand()/100

CALCULATE([No], TOPN(5, ALL(Table[Name]), [rank]), values(Table[Name]))

 

As the values are same it will give 5 but can not assure which 5 for same value



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Helpful resources

Announcements
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Microsoft Ignite

Microsoft Ignite with Arun Ulag

Featured Session Drive Data Culture with Power BI: Vision, Strategy & Roadmap. Register here https://myignite.microsoft.com #MSIgnite #PowerPlatform #Power BI ​

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors