Forum Discussion

callum's avatar
callum
Helper II
9 years ago

Boolean slicer-like element?

Hi,

 

One column in my data is the type of payment for car parks, e.g. free, pay and display, etc.

 

I want to add a checkbox that will filter the data to only the free car parks, i.e. when it's checked then only the free car parks are shown, when it's unchecked then all are shown. How might I do this?

 

If I use a normal slicer element then it shows all the different types. Which obviously can have the effect of filtering only the free ones, but is a bit more bloated than it perhaps should be.

 

I have added another column with DAX to indicate whether it's free or not:

Free = IF([Type of car park] = "Free", TRUE(), FALSE())

but I don't know where to go from here.

 

Thanks

8 Replies

  • Is there any official PowerBI Idea that would solve this? I would have at least half a dozen applications of this, so I would love to vote for an implementation of this.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi callum

     

    Given that your "Free" column works as intended, you just add it to a slicer-visual and use it as your please. 

     

    Let me know if you need any help.

     

    Best,

    Martin

    • callum's avatar
      callum
      Helper II

      Thanks for the response. I maybe should have been more specific in my question. By applying the Free column to the slicer I still end up with two checkboxes, labelled true and false. What I'm after is just one single checkbox, labelled something like "Only show free car parks" for example. However if there is no way to do this then I suppose I'll have to make do with your suggestion.

      • Anonymous's avatar
        Anonymous
        Not applicable

        I'm afraid there isn't any other solution. Not that I know of, at least. 

  • shebr's avatar
    shebr
    Resolver III

    Hi callum,

     

    Have you considered using Bookmarks? With bookmarks you can create a filtered view of your data by the use of a 'button' and apply the filter using action tab. That way when you click the button you can filter the data. You may also need another button that goes back to the unfiltered view.

     

    Here's a video that show how to use the bookmarks feature.

     

    https://youtu.be/j-KP1G_c8PQ