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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Check if timestamp time is greater than time right now, dont include date

Hi,

 

I I'm trying to create a column where I check if the time right now is greater or less than the timestamp I have in another column. Problem is that this column also has the date in it, which means that when I do a simple if statement, the time now will always be greater than the other column. 
Is there a way to solve this? btw I can't do this in power query so must be done using dax.

example:

Timestamp  time  nowgreater or less than time now
02.11.2020 08:00:00  08:00:00  12:46:00                                 1
30.10.2020 12:54:51  12:54:51  12:46:00                                 0

 

I get time directly from timestamp by changing datatype. 
Now is simply = Now()

Greater or less than time now = if (table[now) > table[time], 0, 1)

This last measures gives all 1s now because now is abviously always greater than previous dates but I want that calculation to ignore that. Can this be done using dax?

 

Thank you!

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

You can get only time like this

time(hour(now()),minute(now()),second(now()))

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

View solution in original post

LP2803
Responsive Resident
Responsive Resident

Hi, Plz find the below approach

 

Measure : CurrentHours = HOUR(now())
Column : Hours from Timestamp = HOUR(Table5[timestamp])
Measure : 
check = IF([CurrentHours]>MAX(Table5[Hours from Timestamp]),"Yes, Its Greater","No, Its Lesser")

 

LP2803_2-1604491891627.png

 

View solution in original post

2 REPLIES 2
LP2803
Responsive Resident
Responsive Resident

Hi, Plz find the below approach

 

Measure : CurrentHours = HOUR(now())
Column : Hours from Timestamp = HOUR(Table5[timestamp])
Measure : 
check = IF([CurrentHours]>MAX(Table5[Hours from Timestamp]),"Yes, Its Greater","No, Its Lesser")

 

LP2803_2-1604491891627.png

 

amitchandak
Super User
Super User

You can get only time like this

time(hour(now()),minute(now()),second(now()))

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

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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