Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hey all,
I am probably missing something stupidly easy, but I have two columns:
| Date 1 | Date 2 |
| 31/01/2022 08:12:01 | 31/01/2022 09:32:46 |
| 31/01/2022 08:10:53 | 31/01/2022 08:12:26 |
| 31/01/2022 07:58:50 | 31/01/2022 08:03:30 |
What I am trying to achieve is a column or measure that can tell me the difference between these two fields, for example it would look like:
| Date 1 | Date 2 | Difference |
| 31/01/2022 08:12:01 | 31/01/2022 09:32:46 | 01:20:45 |
| 31/01/2022 08:10:53 | 31/01/2022 08:12:26 | 00:01:33 |
| 31/01/2022 07:58:50 | 31/01/2022 08:03:30 | 00:04:40 |
But I cant seem to make this happen? When I try a measure of simply date2-date1, it doesnt work. Datediff doesnt let me choose my date1/2 fields to put into the measure. I add a column into the data query to generate it row by row but when I try to convert that value to time it errors saying it cant be done on a direct query dashboard?
Any help greatly appreciated!
Solved! Go to Solution.
@MikeLanglois You need to convert the hh:mm:ss to seconds, perform the subtraction and then convert back to hh:mm:ss or use Chelsie Eiden's duration to keep it as a numeric value with a custom format string.
Duration to Seconds Converter - Microsoft Power BI Community
Chelsie Eiden's Duration - Microsoft Power BI Community
@MikeLanglois You need to convert the hh:mm:ss to seconds, perform the subtraction and then convert back to hh:mm:ss or use Chelsie Eiden's duration to keep it as a numeric value with a custom format string.
Duration to Seconds Converter - Microsoft Power BI Community
Chelsie Eiden's Duration - Microsoft Power BI Community
Thanks for the links. What an incredibly long winded way of doing one value minus another! Assumed it would be that simple as it is on other Microsoft products.
Anyway thanks again
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 48 | |
| 40 | |
| 37 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 70 | |
| 67 | |
| 32 | |
| 27 | |
| 25 |