Forum Discussion

jb_karlsson's avatar
jb_karlsson
Frequent Visitor
6 years ago
Solved

Error handling in creating duration custom column

Hi, I'm quite new to Power Bi and I'm currently trying to transform a timestamp column Seconds into a duration type of column.

But the null values generates an error and we don't want to remove or replace the null values before creating the duration column. Preferably the it should say null instead of Error in the new column.

Has anyone any solution for this?

Regards Johan

 

 

 

 

  • Icey's avatar
    Icey
    6 years ago

    Hi jb_karlsson ,

    You can try to replace errors.

     

     

    Best Regards,

    Icey

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

5 Replies

  • VasTg's avatar
    VasTg
    Memorable Member

    jb_karlsson 

     

    Try this..

     

    =if [Seconds] <> null then #duration(0,0,0,[Seconds]) else #duration(0,0,0,0)

     

    If it helps, mark it as a solution.

    Kudos are nice too

    • jb_karlsson's avatar
      jb_karlsson
      Frequent Visitor

      Hi, no it didn't help, it removed the null values and replaced them with 0.00:00:00.

      Regards Johan

      • Icey's avatar
        Icey
        Community Support

        Hi jb_karlsson ,

        You can try to replace errors.

         

         

        Best Regards,

        Icey

         

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.