Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Between slicer for categorical values

Hello together,

 

I need you help again.

 

I am trying to create a between-slicer with categorical values/strings (e.g.: "A", "B", "C", "D", "E", "F"). That is easy with a date column. But I dont have the option to make the slicer as a between slicer with a column which has categorical values.

 

Do you have an idea?

 

Best regards

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

    Since the data type of the column Category is Text type, it will not display Between option on the slicer...Only the data type of the column is Date or Number, the Between option can enable in the slicer... You can find the details in the following official documentation.

    Slicers in Power BI

    Numeric range slicer

    Date slicer

     

    You can create a calculated column as below to rank the column Category and apply this new column on the slicer. Please find the details in the below screenshot or the attachment...

    Rank = RANKX('Table','Table'[Category],,ASC,Dense)

    Best Regards

7 Replies

  • Anonymous , Create two independent tables on that and use two slicer for bewteen

     

    Category Range Using 2 slicer =
    var _max = minx(allselected(Cat1), Cat1[Date])
    var _min = maxx(allselected(Cat2), Cat2[Date])
    return
    calculate(countrows(Table), Filter(Table,Table[Cat] <=_max && Table[Cat] >=_min) )

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      amitchandak 

       

      Thanks for your reply. Could you please describe your solution in detail? I did not get it to be honest.

      I have to following table:

       

      Table1

      CategoryValue
      A123
      B325
      C123
      D502
      E20
      F14

       

       

      Now I should create two tables from Table1? 

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hello togehther,

         

        does someone have a solution for my issue?

         

        Best regards