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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello all.
I have two columns "Date" and "Time". I need to add a third column with the date "New Date".
The date should change not at 00:00 but at 06:00.
Example:
Weighing date March 1, 2023, time 11:39, "New date" March 1, 2023
Weighing date March 2, 2023, time 04:56, "New date" March 1, 2023
Thank you in advance for your cooperation.
Solved! Go to Solution.
you may try
New Date =
DATEVALUE (
'Table'[2nd Weight Date] + 'Table'[2nd Weight Time]
- TIME ( 6, 0, 0 )
)
you may try
New Date =
DATEVALUE (
'Table'[2nd Weight Date] + 'Table'[2nd Weight Time]
- TIME ( 6, 0, 0 )
)
Thanks a lot for help, now it's working.
I believe I understand this as for any times before 6am, the new date column should show the previous date, for times of 6am or later it should show the 2nd Weight date. Because this is a static property of the 2nd weight, and the 6am changeover time doesn't change, I suggest doing this in PowerQuery.
Here's an expression to do this with a custom column in PowerQuery:
if Time.Hour([2nd Weight Time]) >= 6 then [2nd Weight Date] else Date.AddDays([2nd Weight Date], -1)
Here's the equivalent in DAX for a calculated column, but this would be less performant, so try the above first:
Thanks a lot, but I tried this way and it's not workig.
User | Count |
---|---|
15 | |
11 | |
6 | |
6 | |
5 |
User | Count |
---|---|
29 | |
17 | |
11 | |
7 | |
5 |