Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

If then query with dates

I am trying to write an if then statement in power query for a custom column named "2023 Days".  The purpose is to give me the total days a project is active in 2023.   I have the following data: ...
  • Mikelytics's avatar
    3 years ago

    Hi Anonymous 

     

    if [Planned Completion Date] > #date(2023,12,31) then 365 else [Planned Completion Date] - #date(2023,1,1)

     

    Use formula

    transform to whole number

     

    Best regards
    Michael
    -----------------------------------------------------
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    Appreciate your thumbs up!
    @ me in replies or I'll lose your thread.