Forum Discussion
Anonymous
6 years agoNot applicable
Date and Time Custom Column If/Then Syntax
New to Power BI and I need to create syntax for a custom column to include: DAY OF WEEK ONLY as Friday and TIME ARRIVED ONLY as after 5:00:00pm, DAY OF WEEK ONLY as Saturday - no time restriction...
- 6 years ago
Anonymous
I am not good at M, maybe you can try
if Text.End([DAY OF WEEK ONLY],3)="Fri" and [TIME ARRIVED ONLY]>#time(17,0,0) then "1_Fri" else if Text.End([DAY OF WEEK ONLY],3)="Sat" then "2_Sat" else if Text.End([DAY OF WEEK ONLY],3)="Sun" then "3_Sun" else 0
ryan_mayu
6 years agoSuper User
Anonymous
I am not good at M, maybe you can try
if Text.End([DAY OF WEEK ONLY],3)="Fri" and [TIME ARRIVED ONLY]>#time(17,0,0) then "1_Fri" else if Text.End([DAY OF WEEK ONLY],3)="Sat" then "2_Sat" else if Text.End([DAY OF WEEK ONLY],3)="Sun" then "3_Sun" else 0Anonymous
6 years agoNot applicable
Woohoo! ryan_mayu this worked perfectly! Thank you so much, you're my hero!