Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Custom date column using quarters

I am trying to create a custom column which will display "Past" , "Present", and "Future" based on criteria below.  Current quarter today (7-19-22) is Q3   Past = before last Quarter  ( Q1 22, Q4 ...
  • v-jingzhang's avatar
    4 years ago

    Hi Anonymous 

     

    You can add a custom column with the following code

    if [Date] < Date.AddQuarters(Date.StartOfQuarter(Date.From(DateTime.LocalNow())),-1) then "Past" else if [Date] < Date.AddQuarters(Date.StartOfQuarter(Date.From(DateTime.LocalNow())),4) then "Present" else "Future"

     

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.