Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Sort by Columns

Hello guys,     I created a calculated column which helped me to categorize the tenure of my employees. The results are the following   0-30 days  31-60 days  61-90 days 91-180 days 181- 365...
  • jdbuchanan71's avatar
    jdbuchanan71
    6 years ago

    Anonymous 

    Try changing them to this.

     

    Tenure =
    VAR _Days =
        TODAY () - Agents[Production Date].[Date]
    RETURN
        SWITCH (
            TRUE (),
            _Days <= 30, "0-30 Days",
            _Days <= 60, "31-60 Days",
            _Days <= 90, "61-90 Days",
            _Days <= 180, "91-180 Days",
            _Days <= 365, "181-365 Days",
            "+365 Days"
        )
    
    Tenure ID =
    VAR _Days =
        TODAY () - Agents[Production Date].[Date]
    RETURN
        SWITCH (
            TRUE (),
            _Days <= 30, 1,
            _Days <= 60, 2,
            _Days <= 90, 3,
            _Days <= 180, 4,
            _Days <= 365, 5,
            6
        )