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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Learner_SG
Helper IV
Helper IV

subtract time difference dax

Hi , I would like to  create a column to show the  values as 1 if the time difference between the current time and the recorded times in the table is between 0 to 30 mins. ,meaning to say I want to show only the last 30 mins data as 1 and the rest of them should be zero. Could anyone help.Thanks.

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi,you can use this dax :

Is IN 30Minutes = IF((now()-Sheet1[date])*24<=0.5,1,0)

View solution in original post

@Anonymous , thanks a lot. modified my table to datetime and it worked.thanks.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi,you can use this dax :

Is IN 30Minutes = IF((now()-Sheet1[date])*24<=0.5,1,0)

@Anonymous , thanks a lot. modified my table to datetime and it worked.thanks.

Hi @Anonymous ,thanks for the reply.  I wonder why I am not getting the right answer? Does it need to be date time or just the date alone?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.