Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

change duration format to decimal

Hello I am new to PowerBI and I added a custom column to calulate time with the following formula : if [#"Priority Rating (DVP)"] = "Critical" and DateTime.Date( DateTime.LocalNow() )-[First Seen] ...
  • Omid_Motamedise's avatar
    2 years ago

    the problem is for the below condition

     DateTime.Date( DateTime.LocalNow() )-[First Seen] <= 30

    in the left site of <= we have duration format in the right side we have number, change the number to duration by using #duration(30,0,0,0).
    I also recomended to use the below formula for this part in some cases your format might be mismatch.


    (Date.From( DateTime.LocalNow() )-Date.From([First Seen])) <= #duration(30,0,0,0)