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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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