cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
malikara46
Frequent Visitor

Rank Top 3 competitors by Market share

Dear Power BI community, 

 

I want to display our Top 3 competitors ranked by the market share. 

 

Roughly my table looks like this where each line represents a project with a respective status, volume and if awarded the project winner. Of course if status is lost then a competitor has won the project where we want to display which top 3 competitors have the most share on the overall project volume. 

So the total project volume of all awarded projects (status wonor lost) is 184.000 while Competitor A has won 2 projects with a total volume of 37.000. 

37.000/184.000= 20,11 % market share. 

malikara46_0-1622473458306.png

The final result should look like this where our company and OTHERS should not be listed. 

 

malikara46_2-1622473890274.png

 

I tried something like this to calculate share per Winner but do not know how to filter top 3 out of this. Problem is that OurCompany is also shown on the list so I have to filter it out from the final result

 

VAR Volume =
CALCULATE(
SUM('TK Project'[SMO Volume Market weighted]),
'TK Project'[Status] = "Won" || 'TK Project'[Status] = "Lost")
Var AllVolume =
CALCULATE( SUM('TK Project'[SMO Volume Market weighted]), ALL('TK Project'[Winner]),
'TK Project'[Status] = "Won" || 'TK Project'[Status] = "Lost")
RETURN
DIVIDE(Volume,AllVolume)

 

Would appreciate any help. 

 

With best regards

 

 

 

1 ACCEPTED SOLUTION

Hi  @malikara46 ,

 

First create a column as below:

Percent = 
var _total=CALCULATE(SUM('Table'[ProjectVolume]),FILTER(ALL('Table'),'Table'[Project Status] in {"Won","Lost"}))
var _winner=CALCULATE(SUM('Table'[ProjectVolume]),FILTER(ALL('Table'),'Table'[Winner]=EARLIER('Table'[Winner])&&NOT('Table'[Winner] in {"OurCompany","Others",""})&&'Table'[Project Status]<>"Ongion"))
Return
DIVIDE(_winner,_total)

Then create a measure as below:

_rank = RANKX(ALL('Table'),CALCULATE(MAX('Table'[Percent])),,DESC,Dense)

Put the measure in the filter pane,choose is less than or equal to 3:

v-kelly-msft_0-1622606956798.png

 

And you will see:

v-kelly-msft_2-1622607131749.png

 

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

View solution in original post

8 REPLIES 8
parry2k
Super User
Super User

@malikara46 in your post you never mentioned that % is based on the won amount, is the ranking on won amount too? What is the logic for that?

 

You have to provide as much clarity as possible, nobody is going to guess what logic you want to work with.






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.





@parry2k 

I updated the original post. 

 

So the logic is as following:

 

In the table each line represents a project with a respective status, volume and if awarded (status is won or lost) the project winner. If status is lost then a competitor has won the project where we want to display which top 3 competitors have the most share on the grand total project volume of all the awarded projects. (sum of every project volume with status won or lost)

 

So the sum of all awarded project volumes (status won or lost) is 184.000 while Competitor A has won 2 projects where the sum of those project volumes is 37.000. 

37.000/184.000= 20,11 % market share. 

Hi  @malikara46 ,

 

First create a column as below:

Percent = 
var _total=CALCULATE(SUM('Table'[ProjectVolume]),FILTER(ALL('Table'),'Table'[Project Status] in {"Won","Lost"}))
var _winner=CALCULATE(SUM('Table'[ProjectVolume]),FILTER(ALL('Table'),'Table'[Winner]=EARLIER('Table'[Winner])&&NOT('Table'[Winner] in {"OurCompany","Others",""})&&'Table'[Project Status]<>"Ongion"))
Return
DIVIDE(_winner,_total)

Then create a measure as below:

_rank = RANKX(ALL('Table'),CALCULATE(MAX('Table'[Percent])),,DESC,Dense)

Put the measure in the filter pane,choose is less than or equal to 3:

v-kelly-msft_0-1622606956798.png

 

And you will see:

v-kelly-msft_2-1622607131749.png

 

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

View solution in original post

Thank you very much!! Works as intended. 

parry2k
Super User
Super User

@malikara46 can you put raw numbers on how you are getting the %?? I don't think what are you replying helping me get to the %? 






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.





sure sorry for the confusion.

 

Example for "Competitor A" 

 

(37000/184000)*100 = 20,11 %

 

malikara46_1-1622478437791.png

 

 

parry2k
Super User
Super User

@malikara46 how did you get to that %? Not sure how you are calculating it? Rest is the easy part.






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.





@parry2k 

Sum of volumes of projects won by competitor X  / sum of all projects with status won or lost. 

 

I now see that 'Project'[Winner] <> "OurCompany" || 'Project'[Winner] <> "OTHERS" in my formula didnt make any sense. So I changed it to this

 
Competitor share=
VAR Volume =
CALCULATE(
SUM('Project'[Volume]),
'Project'[Status] = "Won" || 'Project'[Status] = "Lost")
Var AllVolume =
CALCULATE( SUM('Project'[Volume]), ALL('Project'[Winner]),
'Project'[Status] = "Won" || 'Project'[Status] = "Lost")
RETURN
DIVIDE(Volume,AllVolume)

 

I believe the next logical step is to use "Competitor share" inside a Top n formula. 

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!