Forum Discussion

rakeman23's avatar
rakeman23
New Member
3 years ago
Solved

Applying a duration to DateTime

Hello Gurus,   I'm a newbie in Power BI.  I just want to ask if my below syntax is correct.  I just want to create a custom column on which I want to apply a duration of +8 hours since Power BI is ...
  • rakeman23's avatar
    rakeman23
    3 years ago

    Hello again Anonymous 

     

    I got it now Sir.  Instead of null, I just put the DateTime.From([Created]) after else....  Many thanks again.  Cheers! 🍻

     

    = Table.AddColumn( #"Changed Type1", "PHCreatedDateTime", each
    if DateTime.From([Created]) > #datetime(2022,11,11,0,0,0)
    then DateTime.From([Created]) + #duration(0,8,0,0) else DateTime.From([Created]), type datetime)