Forum Discussion
Calculation if time falls between 7pm-midnight
- Anonymous4 years ago
Hi jenniferhoward ,
1. Create a calculated column by using DAX:
Column = IF([time]>TIME(18,59,59) ,DATEADD('Table'[date].[Date],1,DAY),[date])2. Create a custom column in Power Query:
if [time]> Time.FromText("18:59:59") then Date.AddDays([date],1) else [date]
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
if([Time of Cancel]>"6:59:59 PM") && ([Time of Cancel]<"12:01:00 AM"),DATEADD(DateTable[#"Payment Cancellation Date/Time"],+1,DAY),DateTable[#"Payment Cancellation Date/Time"])
- jenniferhoward4 years agoRegular Visitor
I haven't been able to get this to work. Now trying it Power Query and the error is that it can't compare dates with < > operators. This is what I was trying to do.
if [Related Payment Date]>"6:59:59 pm" and [#"Payment Cancellation Date/Time"]<"12:00:00 am" then [#"Payment Cancellation Date/Time"]+1
else [#"Payment Cancellation Date/Time"])