Forum Discussion

RichJW's avatar
RichJW
Icon for Helper III rankHelper III
3 years ago
Solved

Date Field for Next x Month

Hi all,   I'd like to create a new column in PBI Desktop which will look at the "DateField" column (date format) I have and split it into categories for filtering purposes. So, I'd have a "Next 3 ...
  • Arul's avatar
    Arul
    3 years ago

    RichJW ,

    Check if it is working or not in a calculated column,

     

    Slicer = 
    VAR _today = TODAY()
    VAR _today90 = TODAY()+90
    VAR _today180 = TODAY()+180
    VAR _today210 = TODAY()+210
    RETURN SWITCH(TRUE(),
        'Date'[Date]>=_today && 'Date'[Date]<=_today90,"Next three months",
        'Date'[Date]>=_today90 && 'Date'[Date]<=_today180,"3-6 months",
        'Date'[Date]>=_today180 && 'Date'[Date]<=_today210,"6-9 months",
        'Date'[Date]<_today,"Previous Months",
        "Greater than 9 Months"
        )

     

     

    Thanks,

    Arul