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.
I have a datetime column but what I want to do is something like this
DATEDIFF ( datetime, SAMEDAY@ 23:59:59), MINUTE
I cant seem to find a way of working out the end of day using the date from the datetime column.
Cheers,
JP
Solved! Go to Solution.
so I got there in the end. Not ideal but works.
So in my date table i created a column that gives you the end time of each day
End of Working Day =
'Date'[Date] + TIME (23,59,59)
So now I can do a quick lookup to find the end if the day in questions and them work out the difference between the 2. NOTE: you will need a column in your table that shows just the date without the time. This is what you use to search the date table.
DATEDIFF(
Repairs[Main_Date/Time],
LOOKUPVALUE('Date'[End of Working Day], 'Date'[Date], Repairs[Main_Date (Date Only)]),
MINUTE)
Cheers.
so I got there in the end. Not ideal but works.
So in my date table i created a column that gives you the end time of each day
End of Working Day =
'Date'[Date] + TIME (23,59,59)
So now I can do a quick lookup to find the end if the day in questions and them work out the difference between the 2. NOTE: you will need a column in your table that shows just the date without the time. This is what you use to search the date table.
DATEDIFF(
Repairs[Main_Date/Time],
LOOKUPVALUE('Date'[End of Working Day], 'Date'[Date], Repairs[Main_Date (Date Only)]),
MINUTE)
Cheers.
Hi @JPScotland ,
If I took your question correctly then required code would be like below:-
DATEDIFF ( datetime, today(), MINUTE)
BR,
Samarth
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Hey Samarth,
Sorry, I need to be the end of the day on the same date specified by the datetime column.
So if it was 16/05/2022 10:34:05, I would be looking to return 16/05/2022 23:59:59
Cheers,
JP
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 |
---|---|
113 | |
99 | |
80 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |