Forum Discussion

Learner_SG's avatar
Learner_SG
Helper IV
4 years ago
Solved

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.

  • Anonymous's avatar
    Anonymous
    4 years ago

    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.

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi,you can use this dax :

    Is IN 30Minutes = IF((now()-Sheet1[date])*24<=0.5,1,0)
    • Learner_SG's avatar
      Learner_SG
      Helper IV

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

    • Learner_SG's avatar
      Learner_SG
      Helper IV

      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?