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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

How to drive the Top/Bottom 10 Customers.

Hi Team,

 

We have customers more than 100 and we would like to take the Top 10 customers and bottom 10 customers based on the contribution figures.

Can anyone please help with formulas/measures to drive the desirable results.

 

Tob-Bottom ten Customers.JPG

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

hi, @Anonymous 

For your requirement, you could try this way as below:

Step1:

Create two rank measure for [Contribution] measure

Rankx asc= RANKX(ALL('Table'[Customer Short]),[Contribution],,ASC)
Rankx desc = RANKX(ALL('Table'[Customer Short]),[Contribution],,DESC)

6.JPG

Step2:

Create a conditional measure that shows Top/Bottom 10 Customers.

In my simple sample, I just show Top/Bottom 2 Customers

Top/bottom 2 Customers = IF([Rankx asc]<=2||[Rankx desc]<=2,[Contribution])

Result:

7.JPG

and here is my sample pbix file, please try it.

 

Regards,

Lin

Community Support Team _ Lin
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

5 REPLIES 5
v-lili6-msft
Community Support
Community Support

hi, @Anonymous 

For your requirement, you could try this way as below:

Step1:

Create two rank measure for [Contribution] measure

Rankx asc= RANKX(ALL('Table'[Customer Short]),[Contribution],,ASC)
Rankx desc = RANKX(ALL('Table'[Customer Short]),[Contribution],,DESC)

6.JPG

Step2:

Create a conditional measure that shows Top/Bottom 10 Customers.

In my simple sample, I just show Top/Bottom 2 Customers

Top/bottom 2 Customers = IF([Rankx asc]<=2||[Rankx desc]<=2,[Contribution])

Result:

7.JPG

and here is my sample pbix file, please try it.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Tahreem24
Super User
Super User

Hi,

You can select you table visual then go to visual level filter and select the customer name-->advanced filter - - >top n--> drag the column name on which you want to rank your customer

Please give Kudos this effort and mark it as a solution if it helps.
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
AlB
Super User
Super User

Hi @Anonymous 

If this is a table visual, you can use the TopN/BottomN filter on the Contribution column

Ir it is an actual table, you can create another table with

TOPN( 10, Table1, Table1[Contribution], DESC )    // Top10

TOPN( 10, Table1, Table1[Contribution], ASC )    // Bottom10

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

 

Anonymous
Not applicable

Hi 

 

 

 

 

Like I said, you can create new tables or you can do it in table visuals. For creating tables, go to the "Modelling" tab and "New table" and enter the code as follows (Table1 is your original table, the one you show):

NewTableTop10 = TOPN( 10, Table1, Table1[Contribution], DESC )

then another one for the bottom 10:

NewTableBottom10 = TOPN( 10, Table1, Table1[Contribution], ASC )

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.