Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I'm trying to calculate the lead stage duration of Salesforce leads like this:
Unfortunately there is no single way through the stages.
So the end date would come from different stages depending on the next step, e.g. converted or closed.
The stages can be: MQL, Open, Contact_Attempt, Conversation, Unqualified, Converted. They might appear more than once and can be in other order as well.
How can I use different stages, without them overwriting them?
Solved! Go to Solution.
Hi @Anonymous ,
You can create a calculated column as below to get it, please find the details in the attachment.
Column =
VAR _startdate =
CALCULATE (
MAX ( 'Table'[Conversation_Date__c] ),
FILTER ( 'Table', 'Table'[Order] = EARLIER ( 'Table'[Order] ) )
)
VAR _endate =
SWITCH (
[Stage],
"Contact_Attempt", [Contact_Attempt_Date_c],
"Converted", 'Table'[Converted_Date_c],
"MQL", 'Table'[MQL_Date_c],
"Open", 'Table'[Open_Date_c],
"Unqualified", 'Table'[Unqualified_Date_c]
)
RETURN
DATEDIFF ( _startdate, _endate, DAY )
If the above one can't help you, please provide some raw data in your table (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:
How to provide sample data in the Power BI Forum
How to Get Your Question Answered Quickly
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Hi @Anonymous ,
You can create a calculated column as below to get it, please find the details in the attachment.
Column =
VAR _startdate =
CALCULATE (
MAX ( 'Table'[Conversation_Date__c] ),
FILTER ( 'Table', 'Table'[Order] = EARLIER ( 'Table'[Order] ) )
)
VAR _endate =
SWITCH (
[Stage],
"Contact_Attempt", [Contact_Attempt_Date_c],
"Converted", 'Table'[Converted_Date_c],
"MQL", 'Table'[MQL_Date_c],
"Open", 'Table'[Open_Date_c],
"Unqualified", 'Table'[Unqualified_Date_c]
)
RETURN
DATEDIFF ( _startdate, _endate, DAY )
If the above one can't help you, please provide some raw data in your table (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:
How to provide sample data in the Power BI Forum
How to Get Your Question Answered Quickly
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
User | Count |
---|---|
25 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
27 | |
13 | |
13 | |
10 | |
6 |