Forum Discussion

char23's avatar
char23
Icon for Helper II rankHelper II
2 years ago
Solved

Add column and label date as current, previous, and old/blank

Hello, I have a set of data in one table I am trying to label. I want to add a new column and label each date as Current, Previous, and Old. I would like to do this in power query if possible, but ca...
  • PhilipTreacy's avatar
    2 years ago

    Hi char23 

     

    You can use this code in PQ:

     

    Custom Column

    = if Date.IsInCurrentMonth([Date]) then "Current"
    
    else if Date.IsInPreviousMonth([Date]) then "Previous"
    
    else "Old/Blank")

     

     

     

     

    Regards

     

    Phil