Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

mattkocak

Turn your cards into slicers with the Slicer Button custom visual

Hey all,

 

If you're like me, then at some point you've wanted to use a card visual in Power BI as a slicer/filter.

 

Yes, this can in a way be done natively through bookmarks, but there are some drawbacks to this. Bookmarks might affect other filters that you already have in place and you can't select multiple bookmarks at the same time. Similarly, making other clickable/interactive visuals look like a card might not turn out as attractive as you hope and just feels hacky.

 

If you want to avoid these drawbacks and have clicking your card function more similarly to the slicer visual, then you're in luck as I just developed a custom visual for this! It's called Slicer Button and allows you to apply multiple slicers at the same time with a simple click.

 

In the example case described above, we simply use it as a transparent overlay on a card, which then gives the card the appearance of the ability to slice data.

 

Using Slicer Button on CardUsing Slicer Button on Card

 

A YouTube video is linked below that demonstrates how to download and use the visual as well as the GitHub repository that is hosting the visual.

 

Basic Setup & Use: https://www.youtube.com/watch?v=8x2QoE8M2yA&ab_channel=MattKocak

 

GitHub Repository: https://github.com/mattkocak/powerbi-visuals-slicerbutton

 

Additionally, below are two YouTube videos that demonstrate ways to extend the Slicer Button's usage.

 

 

As you may have noticed, this visual has the potential to make any static object sliceable, not just cards. Give it a shot!

 

Please let me know if there are any questions or comments about this development. I'm happy to clarify or address anything.

 

Best,

Matt

Comments

AMAZING!!! Exactly what I was after and so easy to use thank you!

Hi Matt,
This is exactly what I needed. But when I publish the dashboard I cannot use the visual because its an uncertified visual. 

sid_5005_0-1681876559537.png

Is it possible to upload to the Microsoft appsource.?

Hey @sid_5005, publishing a custom visual to the AppSource requires enrollment in the Partner Center. Since this is an independent project and not through an employer, I would need a to set up my own tenant, which would have a monthly cost. Unfortunately, this isn't something that makes sense for me to do.

 

Your system admin controls custom visual restrictions and they could be helpful in resolving this. One option would be for them to add this custom visual to your organizational visuals. I hope a solution like this allows you to use the visual in the future!

@mattkocak Very nice feature! I don't understand why Microsoft doesn't add this capability to their standard slicer. 

 

One suggestion:

How about instead of using the Slicer Value in the Formatting settings, you simply use the filters that I apply in the filter pane to your custom visual and push those to cross filter all the other visuals? 

 

That would allow for

1) unlimited columns instead of just 2

2) using more complex filters like Relative Time, Contains, Starts With, etc. 

 

Then all I have to do is use the same filters that I have on my card visual on your overlay visual. 

I just added this feature idea to see if Microsoft may pick it up natively: 

https://ideas.powerbi.com/ideas/idea/?ideaid=e2415d73-8cf5-ed11-a81c-000d3a7a46ee


One suggestion:
How about instead of using the Slicer Value in the Formatting settings, you simply use the filters that I apply in the filter pane to your custom visual and push those to cross filter all the other visuals?

@RHOU, this is a good suggestion! I'm not sure if the APIs available to custom visuals would allow for this, but if they do then it would be a straightforward and powerful approach. I'm not continuing to do development work on the visual so I wouldn't be the one to implement it, but the code is open source so someone else could tackle this idea if they had the desire.

Just found this visual add-in and love it! However, it doesn't seem to work on the mobile version. Is there to get it to work on the app too?

Amazing feature but unfortunately limited to only development. 

While publishing the error comes due to it being still uncertified. Hence, unable to put this to use. 

Please put this in the app Microsoft 

@aharris15 could you outline your problem more thoroughly and include screenshots?

@mattkocak - figured this out. It doesn't work on the mobile format while in Portrait mode (holding a phone normally), but if you rotate the phone to a Landscape view, then everything works. A weird little quirk, but still functional!

 

Thanks

@mattkocak - This is a very useful visual. However, it doesn't seem to work on PowerBI Report Server. Is there a version that works with Report Server as well?

Hey @CertitudeSeeker, I'm not super familiar with the limitations of Power BI Report Server, but judging from the Does Power BI Report Server Support Custom Visuals? post, this does seem to be possible.

 

There are a couple things that I could guess might be causing you issues:

  • Your admin blocked custom visuals for your organization (Manage Power BI visuals admin settings)
  • As mentioned in the post above, it could be that your Power BI Report Server isn't on a version that supports the custom visual API version used by Slicer Button (powerbi-visuals-api: 4.2.0)

I'm not currently supporting Slicer Button development anymore so I can't look into this further, but a conversation with your admin might be the first step in resolving this. Good luck!

 

Best,

Matt

@mattkocak - You might be right. Such security restrictions are not uncommon here. I thought it was to do with RS as once I published to RS, it didn't work. but worked well on the desktop report designer. Nevertheless, I deviced a workaround by underlaying a horizontal button slicer under cards with same order and values as sorted in the slicer. So effectively I have a button under each card that filters as per the value on the card.

CertitudeSeeker_0-1701384394815.png