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
pedrocordovad
Regular Visitor

How to rank customers and show topN incidence overall

Hi everyone,

 

Im trying to rank customers of my company by revenue and show the % of the TopN over all the revenue. I would also like to show the same index but divided by each division of the company. My rows are work orders, so each customer might be in more than one row. My data is something like this: 

 

YearWork OrderCustomerDivisionRevenue
20151ADiv 150
20162ADiv 260
20173BDiv 370
20154CDiv 280
20165DDiv 390
20176BDiv 1100
20157CDiv 3110
20168FDiv 1120
20179GDiv 1130
201510CDiv 3140
201611CDiv 3150
201712FDiv 3160
201713ADiv 2170
201514BDiv 2180
201615CDiv 2190

 


So I have different work orders and I want to sum all the orders of each customer and rank them, but I don´t need to show the ranking, the goal is to show the % of top N overall. And I need this to be dynamic, as the page has a slicer of years. 

 

I would really appreciate any help. Thanks! 

5 REPLIES 5
v-danhe-msft
Employee
Employee

Hi @pedrocordovad,

From your description, could you mean sum the [Work Order] by [Customer] and calculate the percentage? If so, you could refer to below steps:

Create a new table:

New Table = SUMMARIZE('Table1','Table1'[Customer],"Sum of Work Order",SUM(Table1[Work Order]))

1.PNG

Create the relationship between the two tables:

1.PNG

Create a measure:

Top N% = SUM('New Table'[Sum of Work Order])/CALCULATE(SUM('New Table'[Sum of Work Order]),ALL('New Table'))

Result:

1.PNG

If I misunderstand you, could you please post your desired result if possible? Also, you could download my pbix file to have a view.

 

Regards,

Daniel He

 

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

Thank you Daniel!

 

Eventhough your answer is not exactly what im looking for, I think its the best first step to get there. With that table I will be able to do what I want. But I have one problem creating the table. Everything is ok until I try to conect both tables ("table 1" with "new table"). The power bi says that "you cant create a relation between this two colums because one of them must have unique values". I don´t understand the problem since the new table by default should have unique values (each customer). 

tables problem.PNG

 

Maybe the problem is that customer colums in both tables must have unique values. In that case of course thats not possible, since the first table has many work orders for each customer. Could you help me with this? Again thank you very much! 

 

Best regards,

Pedro

 

Hi @pedrocordovad,

Could you please share the pbix file if possible and post your desired result?

 

Regards,

Daniel He

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

 

Hi Daniel,

 

I feel stupid but I cant share the file. There is no option here :/. Maybe im doing something wrong. Can´t belive it. 

 

No Option2.PNG

Hi @pedrocordovad,

You could upload your report to your OneDrive or Dropbox and send the link to me.

 

Regards,

Daniel He

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

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.