Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Getting a custom slicer

Hi,

 

I have two slicers, both which filter data on numerical value columns. I don't wish to have range, just a single cell for each of the slicers where a user inputs the two values and i get the data which follows any one of the conditions.

I have tried the greater than visual but it still gives two boxes and greys out the maximum one which doesn't look tidy. Is there anything else possible?

 

 

  • Hi, Anonymous 

    According to your description, I can roughly understand your requirement, I think you can achieve this using two calculated tables and a measure, you can try my steps:

    1. Create two calculated tables like this:

     

    Slicer1 = SUMMARIZE('Data',[Value])
    Slicer2 = SUMMARIZE('Data',[Value])

     

    1. Create a measure like this:

     

    Flag =
    
    var _range1=ALLSELECTED(Slicer1[Value])
    
    var _range2=ALLSELECTED(Slicer2[Value])
    
    return
    
    IF(MAX('Data'[Value]) in _range1||MAX('Data'[Value]) in _range2,1,0)

     

    1. Then you can create two slicers to place the two new table columns and a table chart to apply a visual filter on this chart like this:

     

     

    And you can get what you want, like this:

    You can download my test pbix file below

    Thank you very much!

     

    Best Regards,

    Community Support Team _Robert Qin

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

3 Replies

  • Anonymous you can create two what-if parameters and turn off slider, it will leave with a box to input the value:

     

    Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS  I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

  • v-robertq-msft's avatar
    v-robertq-msft
    Community Support

    Hi, Anonymous 

    According to your description, I can roughly understand your requirement, I think you can achieve this using two calculated tables and a measure, you can try my steps:

    1. Create two calculated tables like this:

     

    Slicer1 = SUMMARIZE('Data',[Value])
    Slicer2 = SUMMARIZE('Data',[Value])

     

    1. Create a measure like this:

     

    Flag =
    
    var _range1=ALLSELECTED(Slicer1[Value])
    
    var _range2=ALLSELECTED(Slicer2[Value])
    
    return
    
    IF(MAX('Data'[Value]) in _range1||MAX('Data'[Value]) in _range2,1,0)

     

    1. Then you can create two slicers to place the two new table columns and a table chart to apply a visual filter on this chart like this:

     

     

    And you can get what you want, like this:

    You can download my test pbix file below

    Thank you very much!

     

    Best Regards,

    Community Support Team _Robert Qin

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

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

       

      Thank you for this. The solution feels like almost close but it's not working exactly.

       

      Since i have two slicers created for two of my columns.

       

      Slicer 1 which is linked to column A

      Slicer 2 Which is linked to column B

       

      Then the flag logic is something which i am not able to understand.

       

      In the table i am actually getting Name and then these Column A & B to check if its working. But the selection doesn't seem to work.

      The table in the visual i am referring to the original file column A & B whereas the slicers are coming from the slicer1 and slicer 2.

       

      I don't seem to understand the max logic with it.

      If slicer1 selections gives range of min and max

      slicer 2 gives its own range of min and max

      We are referring to max of the original column in range of slicer (min, max) || max of second original column in range of slicer2. 

      If i had Table like

       

                Column A        Column B

      ABC     50                      0

      ABC     100                     20

      DEF       100                  0 

      DEF      0                        0

       

      I would see two rows such as 

      ABC      150           20

      DEF       100            0

       

      So if a slicer for 1 is given as 110 and for slicer 2 is given as 0, i should get both the entries 

      If its 100 and 10 , then only ABC should be seen.