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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

How to calculate WinRate

Hello everyone!

 

I'm trying do do a measure thats results in a WinRate.

 

I have those tables (Calendar and Opportunities - from Salesforce).

 

MatheusDodo_0-1697150425898.png

 

In Opportunities table, i have 2 colunms, CreatedDate and CloseDate. CreatedDate is used to connect with Calendar Table.

The logical i want to calculate is:

 

Win Rate % = Numbers of Opps Created in period / Numbers of Opps Closed Won in the same period.

 

The denominator number is independent of created date. For example:

 

In august i had 200 opportunities created (no matter stage name);

In august i had 20 opportunities closed won (stage name = Closed Won and CloseDate = august) and doesnt matter the created date of those 20 opps.

 

Can anyone help me with this measure?

 

Thanks and regards from Brazil!

 

1 ACCEPTED SOLUTION
rubayatyasmin
Super User
Super User

Hi, @Anonymous 

 

see if this code helps

 

Win Rate % = 
VAR TotalOppsCreated = CALCULATE(COUNTROWS(Opportunities), ALL(Calendar), VALUES(Calendar[MonthYear]))
VAR TotalWonOpps = CALCULATE(COUNTROWS(Opportunities), 
                        FILTER(Opportunities, 
                            Opportunities[StageName] = "Closed Won" && 
                            FORMAT(Opportunities[CloseDate], "MMMM") = VALUES(Calendar[MonthName]))
                        )
RETURN
DIVIDE(TotalWonOpps, TotalOppsCreated, 0)

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


View solution in original post

1 REPLY 1
rubayatyasmin
Super User
Super User

Hi, @Anonymous 

 

see if this code helps

 

Win Rate % = 
VAR TotalOppsCreated = CALCULATE(COUNTROWS(Opportunities), ALL(Calendar), VALUES(Calendar[MonthYear]))
VAR TotalWonOpps = CALCULATE(COUNTROWS(Opportunities), 
                        FILTER(Opportunities, 
                            Opportunities[StageName] = "Closed Won" && 
                            FORMAT(Opportunities[CloseDate], "MMMM") = VALUES(Calendar[MonthName]))
                        )
RETURN
DIVIDE(TotalWonOpps, TotalOppsCreated, 0)

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.