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.
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
Would appreciate any help.
With best regards
Solved! Go to 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:
And you will see:
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
@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.
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 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:
And you will see:
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
Thank you very much!! Works as intended.
@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 %?
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.
sure sorry for the confusion.
Example for "Competitor A"
(37000/184000)*100 = 20,11 %
@malikara46 how did you get to that %? Not sure how you are calculating it? Rest is the easy part.
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.
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
I believe the next logical step is to use "Competitor share" inside a Top n formula.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
96 | |
81 | |
74 | |
66 |
User | Count |
---|---|
126 | |
106 | |
105 | |
86 | |
72 |