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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Anonymous
Not applicable

Time Comparisons with NOW()

Hello, 

In a measure, I am trying to compare the time from NOW()to a static value using TIME(), but it is only working on the < condition. The function NOW() is returning 7/28/2020 11:18AM

What I tried:
NOW() < Time(3,30,0) -> returns False

NOW() > Time(3,30,0) -> returns blank()

 

Am I doing something wrong? I have tried wrapping both the NOW() and TIME() functions in TIMEVALUE(), but that seems redundant. I'm kicking myself over this one as it seems so trivial. 

Any help would be greatly appreciated

9 REPLIES 9
MFelix
Super User
Super User

Hi @Anonymous ,

 

I have use the same formulas and getting true and false as expected.

 

What version are you using, and is this a part of a bigger syntax?


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

@MFelix  I am using Version 2.83 (July release) and It is part of a bigger syntax, but I'm testing only the time comparison component. Here is the full code that I am using right now:
Measure =

VAR cur_time = UTCNOW() - TIME(4, 0, 0) //Converts to EST
 
VAR Hold = OR(If(cur_time<TIME(3,30,0) && Dates[Days from Today]=-1, true, false),If(cur_time>=TIME(3,30,0) && Dates[Days from Today]=0, true, false)) //We only show the current day after 330p
 
return If(cur_time > Today() + TIME(3,30,0), true, false)

Is the days from today a column or a measure?


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



amitchandak
Super User
Super User

@Anonymous . because now is date and time. time is only time

Try like

NOW() < today()+ Time(3,30,0)

NOW() >today()+ Time(3,30,0)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak This works with the first condition, but it is still returning Blank() when I try:

NOW() > Today() + Time(3,30,0)

@Anonymous , hope you using that in a fi or filter 

 

try like

if(NOW() >( Today() + Time(3,30,0)) ,1,0) 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak I am using it as a report page filter. I actually made a mistake in my post, as It is actually a calculated column in my date table rather than a measure. 

Regardless, 

if(NOW() >( Today() + Time(3,30,0)) ,1,0) works and returns 1. 

Any idea on why it's returning blank when I switch the true condition to TRUE() and the false condition to FALSE()?

 

@Anonymous , I did not get that 

I tried 

Measure =NOW() > Today() + Time(3,30,0) it retured true 
 
I tried 
Measure = if(NOW() > Today() + Time(3,30,0) ,True(),false())
it retured true 
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@Anonymous ,

Try like a below:

Column1 = IF(NOW()>TODAY()+Time(3,30,0),"Yes","No")
Column2 = IF(NOW()<TODAY()+Time(3,30,0),"Yes","No")
 
 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors