Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
smpa01
Super User
Super User

Date Time Testing (M not DAX)

Hello Experts,

 

I have a Datetime value  column as following

 

Custom
6/3/2019 5:25:07 AM
6/3/2019 6:25:07 AM
6/7/2019 5:57:44 PM
6/7/2019 6:21:17 PM
6/26/2019 3:49:20 PM
7/26/2019 2:36:33 PM
7/25/2019 10:36:32 AM
7/31/2019 1:55:43 PM
5/2/2019 9:18:05 AM
6/21/2019 1:13:03 PM
6/27/2019 5:39:27 AM
7/17/2019 7:20:01 AM
7/17/2019 6:17:48 AM
6/27/2019 5:36:12 AM
7/17/2019 6:12:44 AM
6/27/2019 6:03:51 AM
5/31/2019 12:29:19 PM
7/9/2019 9:27:54 AM
8/8/2019 8:21:38 AM
8/3/2019 7:19:40 AM
6/25/2019 10:05:13 AM

 

I need to test each value for following 2 clauses

A) if the day is Friday is it after 6:00 PM

B) if the day is Monday is it before 6:00 AM

 

I can check the date part by applying Date.DayOfWeekName. But I can't find out how to test whether the time portion is after 1800 hrs on a Friday or 0600 hrs on a Monday.

 

If someone can please point me to the correct direction would be great.

Thank you in advance.

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
2 ACCEPTED SOLUTIONS
jdbuchanan71
Super User
Super User

Give this a try.  

Time.From ([Custom]) > Time.From ("18:00")

This is the check for > 6:00 pm

View solution in original post

@jdbuchanan71  it worked !!! thanks for the help.

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

View solution in original post

2 REPLIES 2
jdbuchanan71
Super User
Super User

Give this a try.  

Time.From ([Custom]) > Time.From ("18:00")

This is the check for > 6:00 pm

@jdbuchanan71  it worked !!! thanks for the help.

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.