cancel
Showing results for
Did you mean:
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.

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

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
Community Support

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:

And you will see:

For the related .pbix file,pls see attached.

Best Regards,
Kelly

8 REPLIES 8
Super User III

@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.

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Frequent Visitor

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.

Community Support

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:

And you will see:

For the related .pbix file,pls see attached.

Best Regards,
Kelly

Frequent Visitor

Thank you very much!! Works as intended.

Super User III

@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 %?

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Frequent Visitor

sure sorry for the confusion.

Example for "Competitor A"

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

Super User III

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

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Frequent Visitor

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.

Announcements

#### Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.