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 need help with calculating time difference by each task.
I have a below table
taskid submittedby starttime endtime state
1 dave Thu, 02 Mar 2023 18:28:17 Thu, 02 Mar 2023 18:28:21 progress
1 dave Thu, 02 Mar 2023 18:28:21 Thu, 02 Mar 2023 18:28:35 progress
1 dave Thu, 02 Mar 2023 18:28:35 Thu, 02 Mar 2023 18:28:43 progress
1 dave Thu, 02 Mar 2023 18:28:06 Thu, 02 Mar 2023 18:28:06 pending
2 roy Thu, 02 Mar 2023 18:38:21 Thu, 02 Mar 2023 18:39:35 progress
2 roy Thu, 02 Mar 2023 18:38:21 Thu, 02 Mar 2023 18:39:35 progress
2 roy Thu, 02 Mar 2023 18:38:35 Thu, 02 Mar 2023 18:39:43 progress
2 roy Thu, 02 Mar 2023 18:38:06 Thu, 02 Mar 2023 18:398:06 pending
I want to display by each task, how long for user to take from pending to progress. I want to display minus minimum pending to minus minimu progress time and how can I achive this by each task by using measure?
Its not giving me correct result. Let me rephrase the quesiton.
id user starttime endtime state
1 dave 6:28:06 pm 6:28:17 pm pending
1 dave 6:28:35 pm 6:28:43 pm in progress
1 dave 6:28:21 pm 6:28:35 pm in progress
1 dave 6:28:17 pm 6:28:21 pm in progress
2 roy 1:00:03 PM 1:00:06 pm pending
2 roy 2:30:08 pm 2:30:12 pm in progress
2 roy 1:00:14 Pm 1:00:29 pm in progress
2 roy 1:00:06 pm 1:00:14 pm in progree
I want to display time difference from pending to in progress where it should pick minimum time for pending state and it should subtract minimum time for in progress state.
I'm thinking something like the following:
Measure =
var pendingStartTime = CALCULATE(MIN([start_time]), ALLEXCEPT(Table, [taskid]), [status] = "pending")
var progressStartTime = CALCULATE(MIN([start_time]), ALLEXCEPT(Table, [taskid]), [status] = "progress")
return progressStartTime - progressEndTime
what is the difference between your first soution and this one?
User | Count |
---|---|
24 | |
10 | |
8 | |
7 | |
6 |
User | Count |
---|---|
32 | |
12 | |
10 | |
10 | |
9 |