The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello everyone!
I'm trying do do a measure thats results in a WinRate.
I have those tables (Calendar and Opportunities - from Salesforce).
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!
Solved! Go to Solution.
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)
Proud to be a 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)
Proud to be a Super User!
User | Count |
---|---|
16 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
9 | |
8 |