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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Anonymous
Not applicable

How to compare date with a function? Help me please.

Can someone help me? I inserted the following function:

 

if [Status] = "in progress" and [Actual End] = null and [Scheduled End]> = Date.IsInCurrentDay then "3" else
if [Real Start] = null and [Programmed End]> = Date.IsInCurrentDay then "1" else
if [Actual End] <= Date.IsInCurrentDay and [Actual End] <= [Scheduled End] and [Actual End] <> null then "1" else "2"

 

I get the following message: Expression.Error: We were unable to apply the <operator to the Function and Date types.
Details:
     Operator = <
     Left = [Function]
     Right = 08/29/2019

Can someone help me?

 

2 REPLIES 2
FrankAT
Community Champion
Community Champion

Hi @Anonymous ,

your query fails because of the missing arguments in function Date.IsInCurrentDay.

Syntax is: Date.IsInCurrentDay(datetime as any) as nullable logical.

Example: Date.IsInCurrentDay(DateTime.FixedLocalNow())

 

Regards FrankAT

Anonymous
Not applicable

Frank and community,

Your help made me realize that this function returns "True" and when compared to the date column the error happens again, because the <operator cannot be applied to the Logical and Date types. Can you help me with a function that shows the current date and I can compare it with date columns, to establish criteria such as "Late", for example. Need me to be more clear? I appreciate the support so far.

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.