Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Help me correct this DAX Sorting Column

I need help solving this formula. It is a sorting column

Age bins Sort =
SWITCH(TRUE(),
    'Table'[Age Bins] = "0- 30 Days",
    "1",
    'Table'[Age Bins]  = "31- 60 Days",
    "2",
    'Table'[Age Bins]  = "61- 90 Days",
    "3",
    'Table'[Age Bins]  = "> 90 Days",
    "4"
    )



  • you can save the last condition, by changing it to:

    Age bins Sort =
    SWITCH(TRUE(),
        'Table'[Age Bins] = "0- 30 Days",
        "1",
        'Table'[Age Bins]  = "31- 60 Days",
        "2",
        'Table'[Age Bins]  = "61- 90 Days",
        "3",
        "4"
        )

2 Replies

  • you can save the last condition, by changing it to:

    Age bins Sort =
    SWITCH(TRUE(),
        'Table'[Age Bins] = "0- 30 Days",
        "1",
        'Table'[Age Bins]  = "31- 60 Days",
        "2",
        'Table'[Age Bins]  = "61- 90 Days",
        "3",
        "4"
        )
    • Anonymous's avatar
      Anonymous
      Not applicable

      Works perfectly. Thanks.