duration
17 TopicsHow to convert DATE/TIME Column to duration?
Hello Everyone, I linked an external database to access and then linked from access to PowerBI. I am trying to create a dashboard to extract worked hours, but when doing the link described above, the worked hours came as DATE/TIME, not duration, so PowerBI does not sum the hours correctly, I need to convert DATE/TIME to duration but didn't find any solution to make this. I already tried to do as bellow EDIT QUERY / Transform Collum / Transform Time only = The time came i.e. 5:00:00. Also tried to convert as Duration, but PowerBI just give me a message of error, not allowing to convert it. Can someone help me?Solved16KViews0likes5CommentsDynamic Format not working with Durations
In my reports, I use durations in seconds for various metrics. It is handy to create visuals and make calculations, but when displaying the values, users prefer to see "hh:mm:ss" instead of the number of seconds. I convert the durations to part-of-day decimal and use FORMAT() to display it as "hh:mm:ss" or "nn:ss" if less than an hour. But this does not work with dynamic formating: although i return a text string containing the appropriate format, it is handled as text instead of being applied to the decimal value as format stirng. So, how can i use dynamic formatting to apply the appropriate format string to a duration? The .pbix demonstrates the issue with a simple example (it's in weTransfer, can't upload here yet): https://we.tl/t-gdqaD1nf3d Thank you, NikosSolved1.7KViews1like4CommentsTrying to work out duration with date time columns and another with minutes
Hi there all, I'm trying to work out a total hours and minutes duration between a start time, end time and then add a to the duration. How can I do this in power bi desktop? (I only need the end calculation of the total time in hours and minutes). ThanksSolved2.4KViews0likes6CommentsConvert Text Time to Duration
I reviewed various previous threads on this matter, but they all seemed to confuse me even further. When I import my Excel report it stores the data below as text, no matter what I format them to within Excel itself. These show H:M:S. - as an example for Logged In it's showing 8 hours:55 minutes:48.197 seconds Logged In Off Queue On Queue Idle 08:55:48.197 01:51:28.360 07:04:19.837 02:36:25.481 I am trying to visualize cards that will show Total Logged In time, Average Logged In time, etc. sliced by a date slicer. But when I use the fields above within PowerBI, there's no SUM or AVG options just First/Last. Please advise how to convert these text fields, I assume a calculated column is in order. Whenever I try to convert data type from text to decimal number it tells me it can't automatically convert. I have lots of columns within this report that need this conversion generated. Thank you for your time and support!Solved752Views0likes1CommentCalculate date range when specific value is reached
Hi all, I am struggling with a date diff calculation. I have found some similar cases in the community, but I can't seem te figure it out. I hope you can help me 😁 My dataset: Table with companies Each company has a create date Table with transactions from companies Each transaction is linked to a company Each transaction has a commission amount that belongs to the company Each transaction has a date What I need to calculate: I want to know how long it takes a company to gather €X (€75 & €50 & €30) in cumulative commission. So I would need to calculate the difference between the company create date and the transaction date (of the transaction that puts the company above the €X bar). And from all this, I would need to get the avg duration it takes a company to get to €X. My questions: How do I calculate the transaction date (of the transaction that puts the company above the €X bar)? How do I calculate the date diff/duration between the create date & the transaction date? How do I calculate the avg duration for all companies who have reached the €X bar? You would make my week with a solution 🙃 Thanks in advance!! AntonSolved1.8KViews0likes7CommentsFind Order Duration based on Start Stop time
Hello, please can you help to find order duration based on starting and finishing time example like in column duration. Order id From To Duration 0 23:00 23:03 1306993 23:03 23:03 1306993 23:03 23:06 1306993 23:22 23:33 1306993 23:33 23:33 1306993 23:34 23:35 1306993 23:35 23:37 1306993 23:38 23:39 1306993 23:42 23:43 1306993 23:43 23:43 00:40 0 23:43 23:44 1305300 23:44 23:45 1305300 23:45 23:46 1305300 23:47 23:47 1305300 23:48 23:49 1305300 23:54 23:54 1305300 23:54 23:55 1305300 23:56 23:59 1305300 23:59 00:00 1305300 00:00 00:01 1305300 00:02 00:03 1305300 00:03 00:03 1305300 00:04 00:04 1305300 00:04 00:07 1305300 00:07 00:07 1305300 00:07 00:08 1305300 00:08 00:09 00:25 0 00:09 00:10 1307012 00:53 00:54 1307012 00:54 00:55 1307012 00:56 00:58 1307012 01:02 01:05 00:12 0 01:05 01:05 1307031 01:05 01:05 1307031 01:06 01:06 1307031 01:11 01:11 1307031 01:13 01:14 1307031 01:19 01:42 1307031 01:44 01:45 1307031 01:45 01:46 1307031 01:46 01:46 00:41981Views0likes3CommentsHow to Find Orders Duration based on Start Stop time
Hello, how its possible to find order duration based on starting and finishing time, for example like in column duration. Order id From To Duration 0 23:00 23:03 1306993 23:03 23:03 1306993 23:03 23:06 1306993 23:22 23:33 1306993 23:33 23:33 1306993 23:34 23:35 1306993 23:35 23:37 1306993 23:38 23:39 1306993 23:42 23:43 1306993 23:43 23:43 00:40 0 23:43 23:44 1305300 23:44 23:45 1305300 23:45 23:46 1305300 23:47 23:47 1305300 23:48 23:49 1305300 23:54 23:54 1305300 23:54 23:55 1305300 23:56 23:59 1305300 23:59 00:00 1305300 00:00 00:01 1305300 00:02 00:03 1305300 00:03 00:03 1305300 00:04 00:04 1305300 00:04 00:07 1305300 00:07 00:07 1305300 00:07 00:08 1305300 00:08 00:09 00:25 0 00:09 00:10 1307012 00:53 00:54 1307012 00:54 00:55 1307012 00:56 00:58 1307012 01:02 01:05 00:12 0 01:05 01:05 1307031 01:05 01:05 1307031 01:06 01:06 1307031 01:11 01:11 1307031 01:13 01:14 1307031 01:19 01:42 1307031 01:44 01:45 1307031 01:45 01:46 1307031 01:46 01:46 00:41Solved1.6KViews0likes7CommentsDate duration with if stament
Hi All, im stuck with the follwing DAX command on my power query. I want to Days Passed to calculate the duration in days based on the status. If status is "complete" then calculate duration from date to date complete. if <> complete then calculate date to current date or Today.I I get this error message Expression.Error: 2 arguments were passed to a function which expects 1. Details: Pattern= Arguments=[List] this is my DAX = Table.AddColumn(#"Extracted Month Name", "Days_Passed", each if [Status] = "Complete" then Duration.Days([Date], [Date Closed]) else Duration.Days([Date], DateTime.LocalNow())) Thanks in advance!Solved968Views0likes3CommentsPower BI DAX: Time Duration calculations displayed as [h]:mm:ss over 24 hrs (145:33:24)
I need assistance with calculating the sum of all the time taken for tasks being done. None of the existing solutions I have tried work as I need them to. The RADACAD example works for the card visual. I have a two tables that have the same columns but are for two different departments, I could append the tables as a single table, but I don't think it makes a difference at this point. The source files are imported from xlsx and the column Duration is General and appears as 03:10:10 It is then imported with Power Query using the Folder option and making changes to the sample file. I need to be able to sum this duration column in Power BI, however I do need to calculate total per user, filtering different dates. I have used transorm to duration, then in DAX SUMX and SUM the values using the var method, splitting and concatinating these values to RETURN a value. This is all good and well if I need to display the total on a card but does not work when using it in a table layout for users not generating data. My Employee table has everyone in, I can filter by department, group, function, manager or any of the other filter values. My data: Employee Duration Emp1 00:00:00 Emp1 null Emp2 00:00:08 Emp2 null Emp2 00:00:00 Emp1 00:26:51 Emp3 00:00:17 Emp4 00:00:09 My requirement is as follows: I need to display the value in hours exceeding 24 hours. As an example 145:33:24 When using the table visual, I drop the group and employeename in the rows field. I also use a slicer on group. In the values field, I cannot use the DAX calculated duration as it then provides everyones time in the rows. I could filter, lock and hide the department, but the problem I have using this is the employees with no data/duration shows the time as :: which is not a usable value and just looks wrong. The values are not usable in a chart as they are in TEXT format. I have spent a lot of time looking for and trying various solutions and none work with the charts or tables thus far. Please help? (Are there future plans for PBI format to include [h]:nn:ss so that it works beyond 24 hrs or Duration to be included in the table Data Type after applying transformation? I don't know who to direct this to as it is probably the devs.)791Views0likes1CommentService Duration in seconds Calculation in DAX
Hi, I have this code in excel that calculates the service duration (in seconds) of a Support ticket, excluding bank holidays, weekends and out of office hours. Excel Code - =((NETWORKDAYS.INTL(A2,B2,1,$H$2:$H$11)-1)*("18:00"-"7:00")+IF(NETWORKDAYS.INTL(B2,B2,1,$H$2:$H$11),MEDIAN(MOD(B2,1),"7:00","18:00"),"18:00")-MEDIAN(NETWORKDAYS.INTL(A2,A2,1,$H$2:$H$11)*MOD(A2,1),"7:00","18:00"))*86400 My Dax code so far - Measure.ServiceHours = VAR _StartDate = SELECTEDVALUE(TICKET_MASTER[TICKETSUBMITDATE]) VAR _EndDate = SELECTEDVALUE(TICKET_MASTER[CLOSEDTIME]) RETURN ((NETWORKDAYS(_StartDate, _EndDate,1,BankHolidayDates)-1)*("18:00"-"7:00")+IF(NETWORKDAYS(_EndDate,_EndDate,1,BankHolidayDates),MEDIAN(mod(_EndDate,1),"7:00","18:00"),"18:00")-MEDIAN(NETWORKDAYS(_StartDate,_StartDate,1,BankHolidayDates)*MOD(_StartDate,1),"7:00","18:00"))*86400 Unfortunately Median dax code works differently to excel, can anyone help me convert this into DAX? Example of excel code working belowSolved1KViews0likes2Comments