datediff
71 TopicsDifference between two columns (date & time)
Hello togehter, is there a way to calculate the difference in hour + / - between two columns? I have column with Date / Time where the ticket is opend, the second columune include the Date / Time SLA. So I need the difference, if the SLA is fall belows or they is exceeded. Many thanks for help.Solved12KViews0likes3CommentsDATEDIFF as DAX Measure
Hello all, I am trying to create a measure that calculates the difference between 2 time columns (hh:mm:ss format) and gives a result as a decimal. DATEDIFF works as a calculated column, but I cannot figure out how to translate to a DAX Measure. My report is saying there is too much space being taken up, so I want to change these columns to measures. Please help!Solved9.4KViews0likes7CommentsCount working days of running month [Friday is weekend only] & Days elapsed
Hi Experts, Please help me out! Struggling to create a measure which will return total working days of current month dynamically [please note, Friday is only weekend in my organization]. I would also want to exclude holidays. I have a calendar table [see scrrenshot], now I want to calculate two measures 1. Total working days of current month 2. Days Elapsed = First Date of current month - Today () -1 [Excluding weekends and holidays] Thans in advance MamunSolved7.8KViews0likes8CommentsQuickly DAX measure fix - Filter
Hi, I want to slightly modify my measure. Currently, it looks like that: Aging = VAR ItemID = SELECTEDVALUE(WH_Invent_Trans[ItemID]) RETURN DATEDIFF(MAXX( FILTER(ALL(WH_Invent_Trans); WH_Invent_Trans[ItemID] = ItemID); WH_Invent_Trans[Date Physical]); TODAY()-1;DAY) But I want add to this measure 2 conditions. Firstly, It must be only TransType = 0 or = 9 (transtype is column in table WH_Invent_Trans with values from 0 to 9) Secondly, QTY<>BLANK (it also column in table WH_Invent_Trans) I would appreciate any ideas 🙂Solved5.9KViews0likes31CommentsCalculate date and time difference greater than one day - Help
Hi guys, I really need some help. I need to calculate the time difference between the dates, but it doesn't work when the time is longer than one day. Example : As you can see on the first line, the Store was inactive on the date of 09 08/22 and was active on the date of 11 08/2022, it also has its opening hours, where I only calculate the time that is within this time . In this example it was supposed to have a time of 19:40h but it calculates 39:40. I really appreciate if anyone can help me.Solved4.6KViews0likes11CommentsHow to represent the datediff result as DD HH MM
Hello, I would like to represent the difference between two dates with days hours and minutes like this: 21 D 2 h 30 m Is there any formula for this? I have used the datediff for finding the difference, but I need to choose between days, hours, min etc. Than you!Solved4KViews0likes5CommentsUsing DATEDIFF in measure
Hello! I've spent some time attempting to use DATEDIFF in a dax measure but failed to do so. Here's the basics; I have two tables, "Sales" and "Stores". I am trying to display sales over time within a one year period and display the sales of store that have not been opened within that year. I also have a year slicer (which is properly working without the filter) like so: When I try to add the desired filter, the graph display: "Cannot display values". Here is my dax measure: Sales Filter = CALCULATE( SUM(Sales[sale]), FILTER(Sales, DATEDIFF(RELATED(Stores[OpenedDate]), VALUES( Sale[Date] ), YEAR) > 1 ) ) Thanks for the help in advance!Solved3.2KViews0likes8CommentsCalculate Hour Type Column Difference
Hi everyone, I text you because I'm trying to calculate the difference between the hour values of the same column. The objective is to find the sum of time for every value of "Defensive Five" column: - To find the difference between the cell below and the one above grouped by another columns (Game and Quarter). I guess that I could use the DATEDIFF and LOOKUPVALUE but I'm not sure how I could use it bearing in mind that the Quarter starts witth value 10:00 and finish with 0:00. To make the comprehension easier, I add a pic of the dataset (the first one) used and the calculation in Excel that offers the expected result (the one I want to get in Power BI with DAX). The second one is a grouped sum after the calculation. Thank you for your time and your knowledge.Solved2.9KViews0likes13CommentsHow to calculate 'service response time' per conversation id
Hi, I would like to calculate the average 'service response time' per conversation id as a measure. The 'service response time' is calculated by the difference between the 'created_at' variable from Y and X in minutes: X = the first row where owner_type = "User" and is_interaction = 1. Y = the first row after X where owner_type = "Agent" and owner_id <> 1 id owner_type owner_id conversation_id message created_at is_interaction 260943 Agent 1 26276 a 2022-03-01 15:00:14 265544 Agent 1 26276 b 2022-03-05 12:01:35 266749 User 153263 26276 c 2022-03-05 15:49:12 1 266750 User 153263 26276 d 2022-03-05 15:49:22 1 266753 Agent 14 26276 e 2022-03-05 15:51:09 267003 Agent 1 26276 f 2022-03-06 12:01:23 268904 Agent 1 26276 g 2022-03-07 12:00:53 271141 Agent 1 26276 h 2022-03-09 12:00:55 271725 User 153263 26276 i 2022-03-09 13:01:07 1 271728 User 153263 26276 j 2022-03-09 13:01:22 1 271727 Agent 10 26276 k 2022-03-09 13:01:23 272085 Agent 1 26276 l 2022-03-10 12:01:26 Any ideas on how to calculate this?Solved2.7KViews0likes9CommentsAdjust matrix dates (in intervals) based on slicer selection
Hello, I have a Power BI report where I am using the Matrix Visual and have a date slicer. In the matrix, I have the Date value in the Column field. I need the dates to adjust with the dates selected in the slicer and also show in intervals of 7 days. I have tried binning the Date field into 7 days, but the last day shown in the Matrix is related to the latest Sunday, vs the last date selected in the slicer. I have also tried several dax formulas, but I can only get the last date shown in the matrix to correspond with the Maximum date in my data set. Any ideas on a formula that will allow me to show the Date field in the matrix in increments of 7 days and also display the last date that corresponds with the latest date selected in the slicer? (In my example below, the last date in the matrix should be 8/31 instead of 9/2). Here is the formula I am using to achieve this:2.6KViews0likes5Comments