Forum Discussion

mpicca13's avatar
mpicca13
Icon for Resolver IV rankResolver IV
5 years ago
Solved

Add/Remove Bins in Bar Chart based on Slicer Selection

I have a bar chart that calculates percentages of negative reviews and groups them in increment ranges of 10%.

so 5 bins in total in the visual (10-20%, 20-30%, 30-40%, 40-50%, >50%)

 

There is also a slicer on the page called Threshold in which if if the user chooses a single selection starting from 10%. and has the option to choose, [20%, 30%, 40%, 50%]

 

Based on the threshold selection, bins the bar chart will be added or removed.

So if 10% is selected, any bin >= 10% is shown (Which would be all bins).

 

if 30% is selected, then the only bins shown would be [30-40%, 40-50%, >50%]

 

How can I go about Dynamically removing bins based on the users selection?

Creating relationship between thresholds table and Bin table will remove all bins with the exception of one (The one with 

the linked relationship)

 

see images below:

 

Chart with slicer

 

Table showing Bin values

 

Threshold table used for slicer

 

Intended Result

 

 

  • mpicca13 , Assume You are already using a measure (called as a measure or use the calculation in use in values of visual)

    Have a new measure  like

     

    new measure =
    var _max = maxx(allselected(Threshold),Threshold[Threshold])
    return
    if(max('High Negative'[Max]) >_max , [Measure], blank())

3 Replies

  • mpicca13 , Assume You are already using a measure (called as a measure or use the calculation in use in values of visual)

    Have a new measure  like

     

    new measure =
    var _max = maxx(allselected(Threshold),Threshold[Threshold])
    return
    if(max('High Negative'[Max]) >_max , [Measure], blank())

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi amitchandak ,

      I have a similar question where I need to filter the bins based on a numeric slicer. For example, if I want to show the bins whose values are greater than 40 only those bins must be visible.


      Can you help me with this to achieve it?