Forum Discussion
Create night shift range
- 2 years ago
You posted this in the Power Query forum, so I have you M code for Power Query.
DAX has a very different syntax.New Column = IF ( Table1[issue time] >= TIME ( 15, 30, 00 ) && Table1[issue time] <= TIME ( 22, 00, 00 ), Table1[issue time], BLANK () )
The following formula in a new custom column will grab all times between 3:30pm and 10:00pm.
if [issue time] >= #time(15,30,00) and [issue time] <= #time(22,00,00) then [issue time] else null
Thank you for response, the sound good but the synatx error showing
- edhans2 years ago
Community Champion
You posted this in the Power Query forum, so I have you M code for Power Query.
DAX has a very different syntax.New Column = IF ( Table1[issue time] >= TIME ( 15, 30, 00 ) && Table1[issue time] <= TIME ( 22, 00, 00 ), Table1[issue time], BLANK () )- hsnluca2 years agoNew Member
Thank you ,it working apprechiate your help , but i think ihave some problem in my filed format , what about if format has date or AM , PM ?? for example in photo
- edhans2 years ago
Community Champion
Doesn't matter. That is formatting. The TIME() function uses military time, so TIME(15,0,0) is 3pm. My formula had both sides as PM times being 15 and 22 hrs...
Could you mark my answer as the solution please so this thread can be marked as completed and others searching for similar info will know that works? Thanks!