Forum Discussion

bdehning's avatar
bdehning
Post Prodigy
3 years ago

24 Hour Round and Null Values

I have a Power Query Text Column that uses:

 

Time.From(if Number.Round( Number.From( [Time of Incident] ) * 24.01 ) / 24=1 then 0.0 else Number.Round( Number.From( [Time of Incident] ) * 24.01 ) / 24)

 

It also returns (Blank) if no time provided and cell is null.  

 

What do I need to do or add to Custom Column to see Not Specified instead of seeing (Blank)?

 

1 Reply

  • you cannot mix datetime and text values. Your replacement value needs to be of the type of the column.

     

    The Power Query equivalent for COALESCE() is two question marks

     

    Let

     

    a = b ?? c ?? "or else"

    in a

     

    will try to assign a the value of b. If b is null then it will try c. if c is null then it will return the "or else" text.