Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 61 | |
| 54 | |
| 41 | |
| 41 | |
| 22 |
| User | Count |
|---|---|
| 171 | |
| 136 | |
| 119 | |
| 80 | |
| 54 |