Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I'm looking for a way to calculate the number of days between when a Service Order status is "2-RECEIVED" to "5-QUOTED". We are looking to report the average it takes orders to go from Received to Quote. Please note that there could be multiple Service Orders records for one Service Order.
Example: How long did it take SRVO-006460 to go from Received to Quote. Our SLA = 7 days.
Solved! Go to Solution.
HI @tmaki828,
You can use following measure to calculate datediff based on current 'document no' and 'before' 'after' fields tag:
Measure =
VAR currNo =
SELECTEDVALUE ( Table[Document No_] )
VAR list =
CALCULATETABLE (
VALUES ( Table[Change Date] ),
FILTER (
ALLSELECTED ( Table ),
[Document No_] = currNo
&& [Before] = "2-RECEIVED"
&& [After] = "5-QUOTED"
)
)
RETURN
DATEDIFF ( MINX ( list, [Change Date] ), MAXX ( list, [Change Date] ), DAY )
Regards,
Xiaoxin Sheng
HI @tmaki828,
You can use following measure to calculate datediff based on current 'document no' and 'before' 'after' fields tag:
Measure =
VAR currNo =
SELECTEDVALUE ( Table[Document No_] )
VAR list =
CALCULATETABLE (
VALUES ( Table[Change Date] ),
FILTER (
ALLSELECTED ( Table ),
[Document No_] = currNo
&& [Before] = "2-RECEIVED"
&& [After] = "5-QUOTED"
)
)
RETURN
DATEDIFF ( MINX ( list, [Change Date] ), MAXX ( list, [Change Date] ), DAY )
Regards,
Xiaoxin Sheng
Hi @tmaki828
Is it not 10 days in the example shown?
Please paste some text format data tha can be readily copied on top of the screen capture.
Is what you show the full table you're working with (I mean all fields)?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 35 | |
| 34 | |
| 31 | |
| 28 |
| User | Count |
|---|---|
| 136 | |
| 102 | |
| 68 | |
| 66 | |
| 58 |