Forum Discussion
Mateusz00
3 years agoFrequent Visitor
New column in DAX
I have two columns: ID Creation Date 1 26.07.2023 09:30:05 2 26.07.2023 12:35:32 3 26.07.2023 15:44:22 4 26.07.2023 17:34:05 5 27.07.2023 08:54:09 6 ...
- Anonymous3 years ago
Hi Mateusz00 ,
You can create the calculated columns as below to get it:
NextDtime = VAR _index = ROUNDUP ( 'Table'[ID] / 3, 0 ) - 1 RETURN ( DATEVALUE ( MIN ( 'Table'[Creation Date] ) ) + _index ) & " " & TIME ( 9, 0, 0 )New Date = IF ( 'Table'[Creation Date] >= 'Table'[NextDtime], 'Table'[Creation Date], 'Table'[NextDtime] )Best Regards
Mateusz00
3 years agoFrequent Visitor
Of course, the point is that at 9 o'clock we transfer the ID to the following days in two cases:
1) when the queue for the day ends
2) when the Creation Date is outside of 9am-5pm.
If the ID is in the queue for a given day and the Creation Date is between 9-17, the date stays the same (ID No. 1 from my example)