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
MoKi
Advocate I
Advocate I

Top 10 customers sales amount comparing with total amount

Hello together, 

I'm using a table of customer orders and there I´ve created a measure of total sales. I can filter my top 10 customers. But how do I manage, in a pie chart for example, to compare the complete turnover of my top 10 customers to the total sales in %?
Thank you very much for your support!

1 ACCEPTED SOLUTION

Solution:

  1. Ranking

Ranking = RANKX(ALLSELECTED(Table1[customer]);[total amount])

  1. Ranking Top 10 and others

RankingTop10_and_others = IF([Ranking] <=10; [total amount]; "Other")

  1. Ranking Top 10

RankingTop10 = var myRank=[Ranking]Return SumX(Values(Table1[customer]);IF(myRank<=10;[RankingTop10_and_others])

)

  1. Top 10 Share %

Top10Share% = DIVIDE([RankingTop10];CALCULATE(sum(amount])))

  1. Other Share %

OtherShare% = 1-[Top10Share%]

 

 

View solution in original post

9 REPLIES 9
parry2k
Super User
Super User

@MoKi can you clarify what you want to do.

 

Assume total sales is 100 and top 10 customer has sales of 60

 

what you want to see in pie chart, 60% as top 10 and 40% as others?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

correct. 

@MoKi what is your top 10 measure, can you share?

 

Add two following measures and change the format to %, in pie chart visual, add both of these measures in Value

 

Top 10 Share % = 
DIVIDE( [Top 10 Sales], CALCULATE( SUM( Table[Sales] ), ALL( Table ) ) )

Other Share % = 1 - [Top 10 Share %]


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

I used the filter for the Top Ten. And the measure to sum all amounts to a total amount. How do I creat a Measure for Top 10? Thanks a lot

I just tried to make a measure with the formula TOPN(10; SUMMARIZE..., but it doesn´t work. I have two tables. One for the orders, there are my customers in and my amounts per customer are in another table. If I try the measure above, I can just refer to the tabel customers and I´m not able to add as Expression the amounts. But perhaps I just do not understand the formula? Or is there another way if I have two different tables? Thank you und best regards. Mo

@MoKi try this link



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hello Perry. thank you a lot. I tried it and now I can rank all customers. But now I have all of them and a ranking until 365. How do I get now a measure with just the best 10 ones? Thank you very much for supporting.

 

Solution:

  1. Ranking

Ranking = RANKX(ALLSELECTED(Table1[customer]);[total amount])

  1. Ranking Top 10 and others

RankingTop10_and_others = IF([Ranking] <=10; [total amount]; "Other")

  1. Ranking Top 10

RankingTop10 = var myRank=[Ranking]Return SumX(Values(Table1[customer]);IF(myRank<=10;[RankingTop10_and_others])

)

  1. Top 10 Share %

Top10Share% = DIVIDE([RankingTop10];CALCULATE(sum(amount])))

  1. Other Share %

OtherShare% = 1-[Top10Share%]

 

 

Hi @MoKi 

 

Can you tell me how can i adjust your formula for the below :

Capture share.PNG

 

Basically the matrix has 2 columns, the the total is perfect for me as calculation of percentage ... the problem is the 2 month before the total .. basically it is calculating the top 10 of each month and not of the accum...

 

IS it possible to adjust the formula to showpercantege of accum top 10 and than for each month for the same product even though that certain month some products are not in top 10  ?

MAny Thanks

Alex

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.