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.
Hello
In the attached I have tried to work out the approval times between each stage in column Step Last Routed.
In the format column it should show in days min and hrs but its putting days to 30 in some cases when it should be 0.
Also, the Approval Time is not displaying the correct date and time from the previous row.
Also, for any step last routed that has "Job Requisition Creation" in Step Description, then it should be blank in the times as this the start of the process in each job req.
Any help would be appreciated. Attachment
Thanks
Ross
Solved! Go to Solution.
@rosscortb
Hope this link will help you: https://radacad.com/calculate-duration-in-days-hours-minutes-and-seconds-dynamically-in-power-bi-usi...
________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
This is abit more complacted than one might think, you need to calculate the days, hour and minutes individually. Take a look at the attached file:
Also, how is the calculation supposed to handle if it's more than 99 days?
Br,
J
The "30" is coming from the date component of the result of subtracting the two dates (12/30/1899). Duration stuff is usually easier in the query editor. However, it can be done in DAX too (with more code). I couldn't refresh against your source data to modify your query directly, so here is the DAX approach. Here are two column expressions to get your desired result I believe. You may want to change the approach on the second one to just return the cycle time in days/hours/min in decimal form so you can use it in calculations (instead of this text column).
Prev Step DateTime =
VAR thisID = Demo[Category ID]
RETURN
CALCULATE (
MIN ( Demo[Step Last Routed] ),
ALLEXCEPT (
Demo,
Demo[Category ID],
Demo[Job Req ID]
),
Demo[Category ID] = thisID - 1
)
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hi @rosscortb,
Did these replies help with your score? If this is a case, you can consider accepting a suitable one to help others who have a similar requirement to find it more quickly.
If all of these not help, you can post here with detailed information to help us clarify your scenario.
Regards,
Xiaoxin Sheng
The "30" is coming from the date component of the result of subtracting the two dates (12/30/1899). Duration stuff is usually easier in the query editor. However, it can be done in DAX too (with more code). I couldn't refresh against your source data to modify your query directly, so here is the DAX approach. Here are two column expressions to get your desired result I believe. You may want to change the approach on the second one to just return the cycle time in days/hours/min in decimal form so you can use it in calculations (instead of this text column).
Prev Step DateTime =
VAR thisID = Demo[Category ID]
RETURN
CALCULATE (
MIN ( Demo[Step Last Routed] ),
ALLEXCEPT (
Demo,
Demo[Category ID],
Demo[Job Req ID]
),
Demo[Category ID] = thisID - 1
)
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
This is abit more complacted than one might think, you need to calculate the days, hour and minutes individually. Take a look at the attached file:
Also, how is the calculation supposed to handle if it's more than 99 days?
Br,
J
@rosscortb
Hope this link will help you: https://radacad.com/calculate-duration-in-days-hours-minutes-and-seconds-dynamically-in-power-bi-usi...
________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
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 |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |