Forum Discussion
Can't select Date Field in Formulas
- 7 years ago
Hi Anonymous
You may create the datediff measure as below.Then add a measure to get the correct total.
DateDiff_seconds = DATEDIFF(MAX(Table1[Start Date]),MAX(Table1[End Date]),SECOND)
DateDiff_seconds_2 = IF(NOT(ISBLANK(SUM(Table1[Start Date]))),DATEDIFF(MAX(Table1[Start Date]),MAX(Table1[End Date]),SECOND))
Total = SUMX(Table1,[DateDiff_seconds])
Regards,
Hi Anonymous
Please create datediff measure with the above formula.
Regards,
This worked, thank you. However, I need to be able to sum the the total for each entry, but since we used Max in the DateDiff formula, the total is coming out as the highest value in the data. So in your example, the sum would be "4:17" when in fact I need it to be "28:17", the sum of the difference. I changed our DateDiff formula from Max to Sum, but this throws the error "An invalid numeric representation of a date value was encountered". I've been researching, and my guess is that it's being caused by some blanks in the data. How would I get around that error?
- Ashish_Mathur7 years agoSuper User
Hi,
Share the link from where i can download your PBI file.
- v-cherch-msft7 years agoMicrosoft Employee
Hi Anonymous
Please post some sample data which could reproduce your scenario.
Regards,
- Anonymous7 years agoNot applicable
I tried posting a sample of my PBIX file. but it would not let me. See below for my sample excel data. I've also included some pictures showing the formulas I am using.
BatchNumber Start Date End Date 1 6/4/2019 13:41 1 2/27/2019 12:55 2/27/2019 12:55 1 3/18/2019 18:30 3/19/2019 8:55 1 1 4/14/2019 10:04 1 4/14/2019 10:11 1 4/14/2019 10:27 1 5/7/2019 10:01 1 5/7/2019 10:01 1 5/7/2019 10:02 1 5/14/2019 15:21 1 5/28/2019 12:46 1 5/29/2019 9:20 1 1/2/2019 10:35 1/2/2019 12:39 1 1/2/2019 15:51 1/3/2019 12:53 1 1/2/2019 15:51 1/3/2019 12:59 1 1/2/2019 15:51 1/3/2019 13:09 1 1/2/2019 15:51 1/3/2019 13:10 1 1/2/2019 16:17 1/2/2019 17:26 1 1/2/2019 16:24 1/2/2019 17:29 1 1/3/2019 16:11 1/3/2019 17:02 1 1/3/2019 16:29 1/3/2019 17:07 1 1/3/2019 17:50 1/4/2019 3:10 1 1/3/2019 17:52 1/3/2019 20:55 1 1/3/2019 17:52 1/4/2019 3:28 1 1/4/2019 10:33 1/4/2019 13:02 1 1/4/2019 13:34 1/5/2019 10:02 1 1/4/2019 13:34 1/5/2019 10:19 1 1/4/2019 13:34 1/5/2019 10:24 1 1/4/2019 15:42 1/5/2019 8:14 1 1/4/2019 15:55 1/5/2019 8:17 1 1/5/2019 22:26 1/6/2019 10:41 1 1/5/2019 22:26 1/6/2019 11:37 1 1/6/2019 12:22 1/6/2019 23:39 1 1/6/2019 12:23 1/6/2019 23:27 1 1/6/2019 12:24 1/6/2019 22:41 1 1/6/2019 12:24 1/6/2019 22:44 1 1/6/2019 12:24 1/6/2019 22:46 1 1/6/2019 12:24 1/6/2019 23:41 1 1/6/2019 12:24 1/7/2019 0:17 1 1/6/2019 15:02 1/6/2019 15:22 1 1/7/2019 11:32 1/7/2019 12:08 1 1/7/2019 11:37 1/7/2019 12:07 1 1/7/2019 16:19 1/7/2019 16:58 1 1/7/2019 20:12 1/8/2019 9:07 1 1/7/2019 20:23 1/8/2019 9:09 1 1/7/2019 20:29 1/8/2019 11:51 1 1/7/2019 20:29 1/8/2019 14:40 1 1/7/2019 20:29 1/8/2019 14:58 1 1/7/2019 20:29 1/8/2019 15:36 1 1/7/2019 20:49 1/8/2019 10:11 1 1/7/2019 20:49 1/8/2019 12:54 1 1/7/2019 20:50 1/8/2019 11:20 1 1/7/2019 20:51 1/8/2019 9:30 1 1/7/2019 21:20 1/8/2019 2:25 1 1/8/2019 8:12 1/8/2019 9:03 1 1/8/2019 10:17 1/8/2019 10:52 1 1/8/2019 10:18 1/8/2019 10:54 1 1/8/2019 12:55 1/8/2019 14:14 1 1/8/2019 14:10 1/8/2019 15:04 1 1/8/2019 23:10 1/9/2019 10:00 1 1/8/2019 23:10 1/9/2019 15:47 1 1/8/2019 23:10 1/10/2019 2:32 1 1/8/2019 23:10 1/10/2019 12:35 1 1/8/2019 23:10 1/11/2019 8:42 1 1/8/2019 23:10 1/11/2019 8:43 1 1/8/2019 23:10 1/11/2019 14:45 1 1/8/2019 23:10 1/11/2019 15:26 1 1/8/2019 23:10 1/11/2019 15:53 1 1/8/2019 23:10 1/12/2019 3:55 1 1/9/2019 7:14 1/9/2019 8:49 1 1/9/2019 12:19 1/9/2019 15:34 1 1/10/2019 12:33 1/11/2019 8:31 1 1/10/2019 16:37 1/11/2019 16:17 1 1/10/2019 16:37 1/11/2019 16:25 1 1/10/2019 16:38 1/11/2019 16:16 1 1/11/2019 9:04 1/11/2019 11:07 1 1/11/2019 9:38 1/11/2019 11:04 1 1/12/2019 20:40 1/12/2019 13:20 1 1/12/2019 20:52 1/12/2019 13:26 1 1/13/2019 19:42 1/13/2019 12:37 1 1/14/2019 8:18 1/14/2019 8:40 1 1/14/2019 8:29 1/14/2019 8:54 1 1/14/2019 12:05 1/14/2019 12:58 1 1/14/2019 14:44 1/14/2019 16:13 1 1/14/2019 15:39 1/15/2019 11:51 1 1/14/2019 15:39 1/15/2019 16:32 1 1/14/2019 15:40 1/15/2019 12:01 1 1/14/2019 15:40 1/15/2019 15:41 1 1/14/2019 15:41 1/15/2019 11:43 1 1/14/2019 15:42 1/15/2019 13:54 1 1/14/2019 15:42 1/15/2019 16:07 1 1/14/2019 16:58 1/15/2019 7:44 1 1/15/2019 9:55 1/15/2019 10:51 1 1/15/2019 10:42 1/15/2019 18:08 1 1/15/2019 10:42 1/15/2019 18:24 1 1/15/2019 10:43 1/15/2019 18:17 1 1/15/2019 10:43 1/15/2019 18:35 1 1/15/2019 10:44 1/15/2019 18:29 1 1/15/2019 10:44 1/15/2019 18:34 1 1/15/2019 10:44 1/15/2019 18:36 1 1/15/2019 10:45 1/15/2019 18:38 1 1/16/2019 8:11 1/17/2019 7:39 1 1/16/2019 8:11 1/17/2019 8:34 1 1/16/2019 8:11 1/17/2019 11:13 1 1/16/2019 8:11 1/17/2019 11:42 1 1/16/2019 8:11 1/17/2019 14:41 1 1/16/2019 8:11 1/17/2019 15:40 1 1/16/2019 8:11 1/17/2019 15:45 1 1/16/2019 8:11 1/17/2019 16:42 1 1/16/2019 8:11 1/17/2019 18:23 1 1/16/2019 8:11 1/18/2019 9:15 1 1/16/2019 8:11 1/18/2019 9:17 1 1/16/2019 8:11 1/18/2019 9:51 1 1/16/2019 8:11 1/18/2019 11:58 1 1/16/2019 8:11 1/18/2019 12:49 1 1/16/2019 8:11 1/19/2019 3:49 1 1/16/2019 8:11 1/19/2019 9:03 1 1/17/2019 9:47 1/17/2019 12:26 1 1/17/2019 9:48 1/17/2019 12:25 1 1/17/2019 14:41 1/17/2019 17:55 1 1/17/2019 14:43 1/17/2019 16:28 1 1/17/2019 17:55 1/18/2019 9:12 1 1/17/2019 17:55 1/18/2019 9:14 1 1/17/2019 17:58 1/18/2019 9:02 1 1/17/2019 17:58 1/18/2019 9:10 1 1/17/2019 20:17 1/17/2019 21:08 1 1/18/2019 9:57 1/18/2019 10:26 1 1/18/2019 10:25 1/18/2019 11:55 1 1/18/2019 10:41 1/18/2019 11:21 1 1/18/2019 13:22 1/18/2019 14:28 1 1/18/2019 17:22 1/18/2019 17:53 1 1/21/2019 15:58 1/22/2019 1:17 1 1/22/2019 15:20 1/22/2019 15:43 1 1/22/2019 16:16 1/22/2019 20:12 1 1/22/2019 16:16 1/22/2019 20:40 1 1/22/2019 16:16 1/22/2019 20:50 1 1/24/2019 10:54 1/24/2019 14:45 1 1/24/2019 12:15 1/24/2019 15:33 1 1/24/2019 12:44 1/24/2019 17:09 1 1/24/2019 12:45 1/24/2019 16:11 1 1/24/2019 12:46 1/24/2019 16:23 1 1/24/2019 14:53 1/24/2019 17:08 1 1/24/2019 14:54 1/24/2019 15:59 1 1/24/2019 14:55 1/24/2019 17:01 1 1/24/2019 14:56 1/24/2019 16:48 1 1/24/2019 15:15 1/24/2019 16:58 1 1/25/2019 10:35 1/25/2019 11:20 1 1/25/2019 16:27 1/25/2019 17:12 1 1/27/2019 14:41 1/27/2019 15:54 1 1/28/2019 11:42 1/28/2019 12:19 1 1/28/2019 13:06 1/28/2019 15:51 1 1/28/2019 13:23 1/28/2019 16:26 1 1/28/2019 13:24 1/28/2019 16:34 1 1/28/2019 13:37 1/28/2019 16:09 1 1/28/2019 13:37 1/28/2019 16:19 1 1/28/2019 15:09 1/28/2019 16:46 1 1/28/2019 15:13 1/28/2019 16:54 1 1/29/2019 15:44 1/29/2019 17:17 1 1/30/2019 8:58 1/30/2019 9:53 1 1/30/2019 8:58 1/30/2019 11:22 1 1/30/2019 15:50 1/30/2019 17:44 1 1/31/2019 12:16 1/31/2019 12:51 1 1/31/2019 12:17 1/31/2019 13:12 1 1/31/2019 12:17 1/31/2019 13:27 1 1/31/2019 12:17 1/31/2019 14:01 1 1/31/2019 12:18 1/31/2019 13:18 1 1/31/2019 12:19 1/31/2019 15:22 1 1/31/2019 12:26 1/31/2019 14:06 1 1/31/2019 12:27 1/31/2019 14:24 1 1/31/2019 15:05 1/31/2019 16:50 1 1/31/2019 15:38 1/31/2019 17:31 1 1/31/2019 15:42 1/31/2019 17:00 1 2/1/2019 11:20 2/1/2019 14:13 1 2/1/2019 11:20 2/1/2019 15:24 1 2/1/2019 11:20 2/2/2019 13:43 1 2/1/2019 11:20 2/3/2019 11:31 1 2/1/2019 11:46 2/2/2019 10:03 1 2/1/2019 11:46 2/2/2019 10:13 1 2/1/2019 11:46 2/2/2019 16:17 1 2/1/2019 11:46 2/3/2019 8:24 1 2/1/2019 13:07 2/2/2019 10:49 1 2/1/2019 14:45 2/2/2019 16:31 1 2/1/2019 14:45 2/3/2019 8:28 1 2/1/2019 14:45 2/3/2019 8:46 1 2/1/2019 14:45 2/3/2019 10:06 1 2/1/2019 14:45 2/4/2019 12:03 1 2/1/2019 15:00 2/2/2019 9:44 1 2/1/2019 15:00 2/2/2019 13:27 1 2/1/2019 15:00 2/2/2019 15:08 1 2/1/2019 15:00 2/2/2019 15:51 1 2/4/2019 11:06 2/4/2019 12:10 1 2/4/2019 11:06 2/4/2019 12:11 1 2/4/2019 15:51 2/4/2019 16:16 1 2/4/2019 16:54 2/4/2019 17:05 1 2/5/2019 8:23 2/5/2019 14:46 1 2/5/2019 8:23 2/5/2019 17:27 1 2/6/2019 16:43 2/6/2019 17:39 1 2/6/2019 16:43 2/6/2019 17:40 1 2/6/2019 16:43 2/6/2019 17:41 1 2/6/2019 16:43 2/6/2019 17:41 1 2/6/2019 16:44 2/6/2019 17:42 1 2/6/2019 16:44 2/6/2019 17:42 1 2/6/2019 16:44 2/6/2019 17:42 1 2/7/2019 7:58 2/7/2019 15:02 1 2/7/2019 10:30 2/7/2019 12:51 1 2/7/2019 14:00 2/7/2019 17:31 1 2/7/2019 15:46 2/7/2019 17:21 1 2/7/2019 16:33 2/7/2019 17:39 1 2/11/2019 9:52 2/11/2019 12:35 1 2/11/2019 9:52 2/11/2019 12:37 1 2/11/2019 9:52 2/11/2019 12:38 1 2/11/2019 14:00 2/11/2019 17:21 1 2/11/2019 14:00 2/11/2019 21:12 1 2/11/2019 18:29 2/11/2019 18:46 1 2/12/2019 10:14 2/12/2019 11:37 1 2/12/2019 10:15 2/12/2019 11:38 1 2/12/2019 10:15 2/12/2019 11:41 1 2/12/2019 17:06 2/13/2019 7:47 1 2/12/2019 17:06 2/13/2019 8:11 1 2/12/2019 17:06 2/13/2019 9:18 1 2/12/2019 17:07 2/13/2019 8:38 1 2/12/2019 17:07 2/13/2019 9:20 1 2/12/2019 17:07 2/13/2019 9:32 1 2/12/2019 17:08 2/13/2019 9:21 1 2/13/2019 12:12 2/13/2019 17:04 1 2/13/2019 12:48 2/13/2019 15:08 1 2/13/2019 12:48 2/13/2019 18:19 1 2/13/2019 12:49 2/13/2019 16:34 1 2/13/2019 12:49 2/13/2019 17:08 1 2/13/2019 12:54 2/13/2019 17:39 1 2/13/2019 13:09 2/13/2019 16:24 1 2/13/2019 13:10 2/13/2019 16:24 1 2/13/2019 13:11 2/13/2019 15:49 1 2/13/2019 14:27 2/13/2019 17:48 1 2/13/2019 14:44 2/13/2019 18:13 1 2/13/2019 14:45 2/13/2019 17:59 1 2/13/2019 15:10 2/13/2019 17:30 1 2/13/2019 15:10 2/13/2019 17:31 1 2/13/2019 15:50 2/13/2019 16:44 1 2/14/2019 13:32 2/14/2019 15:16 1 2/14/2019 13:34 2/14/2019 14:53 1 2/14/2019 15:21 2/14/2019 16:39 1 2/14/2019 15:21 2/14/2019 17:24 1 2/14/2019 15:22 2/14/2019 17:47 1 2/14/2019 15:22 2/15/2019 9:23 1 2/14/2019 15:23 2/15/2019 9:28 1 2/14/2019 15:23 2/15/2019 9:41 1 2/14/2019 15:23 2/15/2019 12:19 1 2/14/2019 15:24 2/15/2019 12:22 1 2/14/2019 15:24 2/15/2019 13:28 1 2/14/2019 15:25 2/15/2019 10:14 1 2/14/2019 18:01 2/15/2019 8:26 - v-cherch-msft7 years agoMicrosoft Employee
Hi Anonymous
You may create the datediff measure as below.Then add a measure to get the correct total.
DateDiff_seconds = DATEDIFF(MAX(Table1[Start Date]),MAX(Table1[End Date]),SECOND)
DateDiff_seconds_2 = IF(NOT(ISBLANK(SUM(Table1[Start Date]))),DATEDIFF(MAX(Table1[Start Date]),MAX(Table1[End Date]),SECOND))
Total = SUMX(Table1,[DateDiff_seconds])
Regards,
- Anonymous7 years agoNot applicable
That worked! Thank you so much for your continued help!