Forum Discussion

RB_Barbour-ABI's avatar
RB_Barbour-ABI
Frequent Visitor
4 years ago
Solved

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.

  • Hi, RB_Barbour-ABI ;

    Try it.

    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:


    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.

3 Replies

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Icon for Community Support rankCommunity Support

    Hi, RB_Barbour-ABI ;

    Try it.

    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:


    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.

    • RB_Barbour-ABI's avatar
      RB_Barbour-ABI
      Frequent Visitor

      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.

       

       

       

      Is there any way around this?