Forum Discussion
Simple Workday/OffHours custom column
- Anonymous1 year ago
Hi SarahHope, lbendlin, thank you for your prompt reply!
We can use the Hour function to return the hour as a number from 0 (12:00 A.M.) to 23 (11:00 P.M.):
Create a calcualted column as shown below:
DayNight = IF( HOUR('Table'[TimeCreated]) >= 8 && HOUR('Table'[TimeCreated]) < 17, "Workday", "Off Hours" )Reference link:
HOUR function (DAX) - DAX | Microsoft Learn
Best regards,
Joyce
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
there is no "time type column". It's a datetime column formatted as time.
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information or anything not related to the issue or question.
If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Please show the expected outcome based on the sample data you provided.
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523