Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
RB_Barbour-ABI
Frequent Visitor

Calculating Win Rate by Company

I am relatively new to Power BI and I am attempting to calculate the win rate between competing companies bidding on projects.

 

The data is set out to have a row per company relationship and so projects have multiple rows. It is possible for a project to have multiple winners and losers. Therefore each row shows the relationship between two companies.

 

For example, Project 1 has one winner (A) and two losers (B,C). Project 4 has 2 winners (A,C) and two losers (B,D).

 

The data is in the format as follows:

 

 ValueWinLoss
Project 15Company ACompany B
Project 15Company ACompany C
Project 25Company BCompany A
Project 25Company BCompany C
Project 39Company ACompany C
Project 46Company ACompany B
Project 46Company ACompany D
Project 46Company CCompany B
Project 46Company CCompany D
Project 58Company CCompany A
Project 58Company CCompany D

 

The ideal ouput would be be a matrix of a winning company against losing companies where the user can select companies by the use of a slicer:

 

Winning Company:Company A<-- Slicer       
          
Losing Companies: Win Number Win ValueLoss NumberLoss ValueTotal BidsTotal Bid Value Win Rate Number (%)Win Rate Value (%)
          
Company B 2111531666.768.8
Company C 2141832266.763.6
Company D 160016100.0100.0

 

I have been able to replicate this in excel with COUTIFS and SUMIFS but have been unable to translate this into Power BI.

 

I apologise for the lack of DAX formulas but I am struggling to get anything close.

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @RB_Barbour-ABI ;

Try it.

vyalanwumsft_0-1658988512049.png

the above as win number and win value.

then create a meaure.

Loss Number = CALCULATE(COUNT([Loss]),FILTER(ALL('Table'),[Loss]=MAX('Table'[Win])&&[Win]=MAX('Table'[Loss])))+0
Loss value = CALCULATE(SUM([Value]),FILTER(ALL('Table'),[Loss]=MAX('Table'[Win])&&[Win]=MAX('Table'[Loss])))+0
Total Bids = COUNT([Loss])+[Loss Number]
Total Bid Value = SUM('Table'[Value])+[Loss value]
Win Rate Number (%) = COUNT([Loss])/[Total Bids]
Win Rate Value (%) = SUM('Table'[Value])/[Total Bid Value]

The final show:

vyalanwumsft_1-1658988634432.png


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

View solution in original post

3 REPLIES 3
v-yalanwu-msft
Community Support
Community Support

Hi, @RB_Barbour-ABI ;

Try it.

vyalanwumsft_0-1658988512049.png

the above as win number and win value.

then create a meaure.

Loss Number = CALCULATE(COUNT([Loss]),FILTER(ALL('Table'),[Loss]=MAX('Table'[Win])&&[Win]=MAX('Table'[Loss])))+0
Loss value = CALCULATE(SUM([Value]),FILTER(ALL('Table'),[Loss]=MAX('Table'[Win])&&[Win]=MAX('Table'[Loss])))+0
Total Bids = COUNT([Loss])+[Loss Number]
Total Bid Value = SUM('Table'[Value])+[Loss value]
Win Rate Number (%) = COUNT([Loss])/[Total Bids]
Win Rate Value (%) = SUM('Table'[Value])/[Total Bid Value]

The final show:

vyalanwumsft_1-1658988634432.png


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

Hi @v-yalanwu-msft ,

 

Thank you very much, this solution is excellent.

 

Unfortunately, if I add a Total to the table to show the selected company's overall numbers, the loss measures return the last company number and not the total.

 

Win Rate Total Row.PNG

 

 

Is there any way around this?

SpartaBI
Community Champion
Community Champion

@RB_Barbour-ABI you can PM me if you want to do a quick zoom to look together

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.