Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
ArrivalTime | Desired Results |
1/30/2023 5:00 | 1/30/2023 8:00 |
1/24/2023 15:00 | 1/24/2023 15:00 |
1/27/2023 17:30 | 1/30/2023 8:00 |
Please, I need to create a column that achieves the result above. When the arrival time is before 8 AM on a weekday then the column should contain 8 AM same day but if the arrival time is later than 4 PM then it should contain 8 AM the next week day. But if the arrival time is on a weekend then it should contain 8 AM the next weekday.
Weekend is Saturday and Sunday and Weekdays are Monday to Friday.
you data table and description is not consistent. I tried following your description:
Result =
VAR _date = FORMAT([ArrivalTime], "m/d/yyyy")
VAR _time = FORMAT([ArrivalTime], "h:mm")
VAR _time8 = TIME(8, 0, 0)
VAR _weekday = WEEKDAY(_date, 2)
VAR _nextweekday =
MINX(
FILTER(
CALENDAR( MIN(TableName[ArrivalTime]), MAX(TableName[ArrivalTime])),
[Date]>VALUE(_date) && NOT WEEKDAY([Date], 2) IN {6, 7}
),
[Date]
)
RETURN
IF(
NOT _weekday IN {6,7} && VALUE(_time)<= _time8,
_date&" "&_time8,
_nextweekday&" "&_time8
)
it worked like this:
you may verify that with more data.
User | Count |
---|---|
88 | |
88 | |
73 | |
67 | |
58 |
User | Count |
---|---|
136 | |
110 | |
91 | |
84 | |
69 |