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
Anonymous
Not applicable

Return NOW if it's the current hour

Hello,

 

I am trying to create a column with empty values if it's not the current hour, else return NOW.

 

I tried this:

 

CurrentHour = IF(Datatime_long[Date] = YEAR(TODAY()) && Datatime_long[Time] = HOUR(NOW()), "NOW","")
 
Could somebody spot the mistake or is there another way to tackle this ?
 
Thanks in advance
 
3 REPLIES 3
camargos88
Community Champion
Community Champion

@Anonymous ,

 

Try this one:

CurrentHour = IF(YEAR(Datatime_long[Date]) = YEAR(TODAY()) && Datatime_long[Time] = HOUR(NOW()), "NOW","")

OR

CurrentHour = IF(
DATE(YEAR(Datatime_long[Date]), MONTH(Datatime_long[Date]), DAY(Datatime_long[Date])
 = TODAY() && Datatime_long[Time] = HOUR(NOW()), "NOW","")


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

Proud to be a Super User!



amitchandak
Super User
Super User

@Anonymous ,Can you share sample data and sample output in table format?

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 

 

The data looks like this but all i get is empty values under the currentHour

Screenshot 2020-11-11 134159.png

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.