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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
mp390988
Helper V
Helper V

How to enter a formula to check if time was before 11am

Hi,

 

I am entering this formula in a custom column inside power query editor:

 

mp390988_0-1745162248825.png

 

What am I doing wrong please?

 

Thanks

2 ACCEPTED SOLUTIONS
SundarRaj
Super User
Super User

Hi @mp390988 , the if you wrap around the "11:00:00" in TimeFromText(), it should work. Thanks!

SundarRaj_0-1745162888371.png

Code:
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type datetime}, {"Time", type time}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each if [Time] >= Time.FromText("11:00:00") then "Yes" else "No")
in
#"Added Custom"

Sundar Rajagopalan

View solution in original post

Vijay_A_Verma
Super User
Super User

In your formula, replace 11:00:00 with #time(11, 0, 0)

or Time.FromText("11")

View solution in original post

2 REPLIES 2
Vijay_A_Verma
Super User
Super User

In your formula, replace 11:00:00 with #time(11, 0, 0)

or Time.FromText("11")

SundarRaj
Super User
Super User

Hi @mp390988 , the if you wrap around the "11:00:00" in TimeFromText(), it should work. Thanks!

SundarRaj_0-1745162888371.png

Code:
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type datetime}, {"Time", type time}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each if [Time] >= Time.FromText("11:00:00") then "Yes" else "No")
in
#"Added Custom"

Sundar Rajagopalan

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors