powerbidata-sciencedaxbusiness-intelligencemsbi

comparing with date values with if condition


I want to compare workers present status with time,

if any worker comes 10 mins Late then it should be like "Below 10 mins"(I tried to derive it from time diff column which I done with help of IN time & Report time )

"IF('Attendance Info'[Time Diff] <= "00:30","Below 10 mins","others")"

and the error is:

DAX comparison operations do not support comparing values of type Date with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values.


Solution

  • A fast google search would have get you the following results:

    In DAX:

    Column = IF('Table'[Column1] <= TIMEVALUE("00:30");"Below10";"Others")
    

    In M:

    = if [Column1] <= Time.FromText("00:30") then "Bleow10" else "Others"