Forum Discussion

M_SBS_6's avatar
M_SBS_6
Helper V
2 years ago
Solved

Date Flag

Hi, 

I need to create a column that creates an output based on date today() minus 3 months. 

 

If app_date 3 months before today then "3 months" else ""

 

So in my table my column would populate "3 months" where app_date is February. 

 

Any idea how to do this please? 

  • M_SBS_6 , You can create a calculated column using below formula

     

    Output Column =
    IF(
    'YourTable'[app_date] <= EDATE(TODAY(), -3),
    "3 months",
    ""
    )

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi M_SBS_6 ,

    Thank you for bhanu_gautam  answer , and I have other suggestions:

    Below is my table:

    The following DAX might work for you:

    Column = IF(DATEDIFF('Table'[Date],TODAY(),MONTH) <= 3 , "3 month",BLANK())

    The final output is shown in the following figure:

    If this doesn't address your needs, can you please post the expected results?

    Best Regards,

    Xianda Tang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies

  • M_SBS_6 , You can create a calculated column using below formula

     

    Output Column =
    IF(
    'YourTable'[app_date] <= EDATE(TODAY(), -3),
    "3 months",
    ""
    )

    • M_SBS_6's avatar
      M_SBS_6
      Helper V

      Thank for the suggestion but that populates previous months with a value to, I.e Feb and all months prior to Feb 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi M_SBS_6 ,

    Thank you for bhanu_gautam  answer , and I have other suggestions:

    Below is my table:

    The following DAX might work for you:

    Column = IF(DATEDIFF('Table'[Date],TODAY(),MONTH) <= 3 , "3 month",BLANK())

    The final output is shown in the following figure:

    If this doesn't address your needs, can you please post the expected results?

    Best Regards,

    Xianda Tang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.