Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I am trying to calculate monthly average enquiry response time in days, but unable to do so. Please can you help? In the attached example, an opportunity (Opp) can have more than 1 quotes. The response time is based on the when the opp was created and when the first quote was sent. The tables are joined using Opp GUID field.
Just to add a bit of extra complexity, but not essential. One quote can be assosicated to more than 1 Opp as well.
Solved! Go to Solution.
Hi @HabibAdil ,
You could create a rank column at first.
Rank =
RANKX (
FILTER ( Quote, Quote[GUID] = EARLIER ( Quote[GUID] ) ),
Quote[Date],
,
ASC,
DENSE
)
Then use LOOKUPVALUE() or RELATED() function to match the resuilt.
Result1 =
VAR a =
LOOKUPVALUE ( Opp[Date], Opp[GUID], Quote[GUID] )
RETURN
IF ( Quote[Rank] = 1, DATEDIFF ( a, Quote[Date], DAY ) )
Result2 =
VAR a =
RELATED ( Opp[Date] )
RETURN
IF ( Quote[Rank] = 1, DATEDIFF ( a, Quote[Date], DAY ) )
Then show the average in the visual.
Here is my test file for your reference.
Hi @HabibAdil ,
You could create a rank column at first.
Rank =
RANKX (
FILTER ( Quote, Quote[GUID] = EARLIER ( Quote[GUID] ) ),
Quote[Date],
,
ASC,
DENSE
)
Then use LOOKUPVALUE() or RELATED() function to match the resuilt.
Result1 =
VAR a =
LOOKUPVALUE ( Opp[Date], Opp[GUID], Quote[GUID] )
RETURN
IF ( Quote[Rank] = 1, DATEDIFF ( a, Quote[Date], DAY ) )
Result2 =
VAR a =
RELATED ( Opp[Date] )
RETURN
IF ( Quote[Rank] = 1, DATEDIFF ( a, Quote[Date], DAY ) )
Then show the average in the visual.
Here is my test file for your reference.
Sample data please. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
94 | |
83 | |
67 | |
59 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |