Show or Hide a Power BI Visual Based on Selection - Excelerator BI

Show or Hide a Power BI Visual Based on Selection

Updated: 29 Jul 2021

I have written a few articles in the past that toy with the ideas of changing visibility and text colour based on selection.  I started to wonder if it was possible to make a visual appear (or not) based on a selection from the user.  There is no out of the box way to do that today. It is possible to use bookmarks to show and hide an object, but the user must click a specific button to do this. I want the user to be able to interact with a report and see (or not see) a chart based on some valid selection across the report.  Microsoft is already working on building expression based formatting across the breadth of Power BI, and currently allows one to change a number of settings ranging from the header in a chart to font colours, backgrounds and data colours.

Solution Overview

My solution to solve this problem involves.

  • Create a card to work as a mask for the visual.
  • Create a measure to display a user message on the card based on the user selection.
  • Create a measure to render the visual blank when nothing is selected
  • Write a measure that returns either the background colour or “transparent” based on the user selection, and set that to conditionally format the background colour of the card.


I have a sample report below.  I want the matrix on the left to appear if the user selects an item in the category slicer on the right.  If there is nothing selected in the slicer, I don’t want to see the matrix at all, but instead see some instructions on what to do.

Hidden Visual Live Connection

Transparent Colours

The key to this solution is the expression based formatting of colours using DAX.  As I described in my article about conditional based text colours linked above, you can set the result of a measure as being any HEX colour you want using conditional colour formatting.  But as it turns out, you can change the transparency of a HEX colour like #FFFFFF by adding an optional additional 2 characters to the end (00 being 100% transparent).  So while #FFFFFF is white, #FFFFFF00 is 100% transparent (white).

The next trick was to have a box that I could colour white or transparent – enter the Card.

Create the User Instructions

The first thing I had to do was to create a measure that displayed a message to the user on the card.  I wanted to show the matrix when the user had selected an item in the Product[Category] slicer and display the message otherwise. This was easy as follows.

Message = 
      "You must first select a Product Category from the slicer to see the results"

Write the Check Filtered Measure

The next thing I needed to do was write a measure that would make the matrix appear blank when no selection in the slicer had been made.

Check Filtered = 

Filter the Matrix to Render Blank

Select the matrix, and place the [Check Filtered] measure onto the “Filters on this visual”, and set the “Show items when the value: is 1”.  This renders the matrix with just 2 rows visible.  This means there is no need to cover the entire matrix with the card layer, we can just cover over the top two rows, to achieve the same visual effect. This is important as it means that the visual will render larger than the card when displaying information, which will enable click interactivity with the displayed cells for further cross-filtering the report.

Check Filtered

Blank Matrix

Create a Card to Work as a Mask

Next, I placed a card visual with the measures [Message] placed in the  “Values” section.  I made the card just big enough to cover the blank visual (top 2 rows). I turned off the card category label. Now the trick is to use conditional formatting for the card background colour using rule based expressions.

Power BI Online Training

Write the Transparent Measure

This was also pretty easy.  I wanted to show the matrix when the user had selected an item in the Product[Category] slicer and hide the matrix otherwise.  The measure I wrote therefore was this.

Make Transparent = 

In other words, if there is a value selected in the slicer, make the “colour” transparent, otherwise make it white (the colour of the report background) so that it hides the matrix.

Format the Card

Then I applied the measure to format the card background colour.  To do this, click on the Card, then select format\Background and switch it on. Then click on the ellipses on the right-side of Color as shown below.

Cond Formatting Card Background

Click on Conditional formatting, Select Format by as “field value” and then select the measure.

Cond Formatting Card Background 2

Importantly, the order of the visuals (front to back) needs to be:

  1. The card
  2. The visual to show/hide.

The Final Result

And here is the final result.

Hidden Visual Live Connection

You can download my sample workbook here.

192 thoughts on “Show or Hide a Power BI Visual Based on Selection”

  1. Matt

    thank you so much for such a simple yet effective method of achieving something you would hope is an option.

    This has worked brilliantly for my adapted need

  2. I’ve managed all the steps – however when I make my selection and the table is populated I’m still seeing the “Please make a selection” message showing over the table?

  3. Hi,
    I am trying to implement as you per your artice but here issue is getting error cannot convert value ‘Monthly’ of type of text to type True/False

  4. mriganka chowdhury

    In my table data I have a column called Category where there is two items 1) Pump and 2) Reactor. In the same table there is another column called level which show values for Reactor, but Nil for Pump. I want to show the water level in my reactors so I used a card, the problem is since In the same page i have two filters, Reactor and pump for pump. it shows level as nil , but when i choose pump I want the card to hide. How can i do that??

    1. Jason Cockington

      Hi Mriganka,
      I am not sure I fully understand, do you have a single column of data Item[Category] and that contains 2 categories (Pump & Reactor)?
      Are you able to share an image of you model design, and your report page?

  5. Hi Matt,

    This is exactly what i want to happen, but every time I go to add the “check filtered” measure into my visual, I am unable to edit the condition of the filter.

    1. Jason Cockington

      Hi Mark,
      Check that your Check Filtered measure is returning an integer not a boolean.
      i.e. it’s returning “1” not “True”.

  6. Hi Matt,

    That’s a nice little workaround. I can think of so many situations where it would be useful. Hopefully, one day, there is a simple show/hide conditional option in visuals in the future; or better still a conditional switch to display two alternate visuals. Meanwhile, thanks for sharing a great, practical woraround.

  7. Is this possible to hide/show Map visual. And I want that zoom in/out control in Map.

    I have tried your approach Matt. I couldn’t able to play around with zoom in/out control since the card is on top of the map visual.

    1. Jason Cockington

      Hi Mugesh,
      Unfortunately the Map won’t disappear with the Check Filtered trick (even if you have a different column slicing on the map, you still have an empty map in view), so the only way to hide the map is to make the card completely cover the map, but if you do that you lose any interactivity with the Map.

      The closest you can get to the solution described above is to cover all but the title of the Map with the message card.
      Then when you make the slicer selection and the card goes transparent, you’ll need to click on the map title (to bring the map to the front). Then you can interact with it.

      It’s not a perfect solution, but it works.

  8. The color formatting is not working as mentioned in my powerbi..i am unable to add measure in the formatting…can anyone help me

    1. Jason Cockington

      Hi Akhil,
      This still works in the May2021 version.
      Make sure you have the Message card selected, then on the background settings, click the fx button.
      When the wizard pop’s up, make sure you have the color settings as follows:
      Format by = Field value
      Based on field = Make Transparent

    2. Eduardo Hoeltgebaum

      I had same problem.
      The measure need to be set to type Text for it to allow you to select it.

        1. Jason Cockington

          Hi Abi,
          This seems to be catching a few people off guard at the moment.
          I am not sure how Eduardo was able to change the field to Text, as it should be Text when you write the measure anyway.
          But, I do know that you won’t be able to select the Make Transparent measure as a field value unless you have first changed the Format By bucket.
          Shows Make Transparent can't be selected
          Once you have set the Format By bucket to “Format by : Field Value”, then you should be able to select the “Make Transparent” measure.
          Shows Make Transparent can be selected
          I hope this helps everyone.

          1. Hey Jason,

            Thanks for getting back in touch – that didn’t work however I have worked out the solution.

            I am not able to add a screenshot – but when you click on the measure at the top the measure tool ribbon appears my measure was automatically set to the data type decimal – I then changed this to Text and it now works

            I hope this helps anyone 🙂

  9. Looks great. Can you check to see if a specific value is selected and return 1, else 0? Not just a column?

    1. Jason Cockington

      Hi Aaron,
      If I understand your request correctly, then the solution is simply to use SELECTEDVALUE() in place of ISFILTERED()
      Check Filtered Value = IF(SELECTEDVALUE(Products[Category]) = “Bikes”, 1, 0)
      Then only when “Bikes” is selected in the slicer will the visual be unhidden.

  10. Excellent!! I have one gauge which supports to filter. This is supporting hide unhide Gauge and drill through feature.

  11. Hello, I think I have a new version of PBI. In my case, there is not 3 ellipses in the background format section. Instead, there is a fx option. This option won’t allow me to select the message measure. Any tips?

    1. Jason Cockington

      Hi Julius,
      This still works in the April 2021 version.
      Make sure you have the Message card selected, then on the background settings, click the fx button.
      When the wizard pop’s up, make sure you have the color settings as follows:
      Format by = Field value
      Based on field = Make Transparent

  12. it is brilliant idea, however, it won’t allow you to scroll from any matrix covered by the card.
    is there any solution for this issue?

    1. Jason Cockington

      Hi Ahmad,
      The benefit of relying on the Check Filtered solution is that the card doesn’t need to cover the entire Matrix, you simply need to make the card large enough to cover the header. Thus, when the slicer is selected, the Matrix data is revealed, and the scroll bar will appear on the right, which can be interacted with as normal.
      Just make sure the card is only covering the Matrix header.

  13. Some reason the check filter is not working on the filter for the matrix, I am unable to put condition = 1 for check filter, powerbi is not responding on the filter pane

  14. I like this trick, but ran into a quick issue when trying to incorporate my tooltips. It appears that placing the “invisible” card in front of my visuals prevents me from being able to hover over charts and view the tooltips for each visual. Has anyone had a similar issue or a way to work around this problem?

    1. That sounds correct to me. I don’t know of any way around it using this method. You could use bookmarks to hide/show instead, but then it would not be sensitive to the slicer selection

  15. Does this solution still work in the most recent release? Power BI does not allow me to set the background conditional formatting (Field Value) to to “Make Transparent”.

    1. I can confirm that this still works in December 2020 release.
      If you would like me to take a quick look at your workbook, I’d be happy to assist.

      1. I figured out what was going on. Power BI wants you to use a “Column” (Field) to drive the color code. I am using direct query with Tabular for our Power BI reports and Microsoft does not allow you to add additional columns to the Power BI model (you can only add Measures).

        I wanted to create a splash screen based on row level security. I was able to accomplish this with a minor change to my data model.

        The magic really is in the “00” at the end of the color code.

        Thank you for verifying and for posting this blog!

      2. Hi Jason,

        Do you mind taking a look at my workbook. The trick seems to be working slicers are used but not when a search bar is used. Thanks

        1. Jason Cockington

          Hi Aleksa,
          Are you referring to the new Search Bar in the Ribbon, or the search that can be added to a slicer?

  16. Hi Matt,
    It worked perfect for my report. Thanks for sharing! However, I got an issue when my Slicer is selected “ALL”, which I guess the CheckFilter could not tell it’s a selection so coded it to 0 (Display the wording ‘You must select…’)
    Is there any method I could implement to fix this issue?

    1. My approach checks for a filter on the column. In your case “all” or “everything” by definition is unfiltered. I can’t think of a way to differentiate between “no filter” and “all”. Maybe you don’t even need to hide the visual if ALL is a valid outcome?!

  17. @Matt Allington, can you please guide me on how to use this technique on donut charts and bar chart? I used that technique, and it is working, but I cannot interact with those visuals where a card is implemented on top. Any idea of how to use it for that? Thanks.

    1. It will be tough. As you know, this is a hack, so there can be issues. All I can think of is to add a bookmark and button that hides the overlay. Maybe the button says “interact” and it hides the overlay. That’s just one thought.

  18. Hi Matt. Love this article. I’m glad there is some conditional formatting available. And it works great!

    Question, what if you want to do a drill through, rather than a slicer? For example, In my slicer i choose multiple entries, but in my table, I drill through the specific entry.

    Is there anyway to do the same thing in drill through?

    And is there a way to clear out all filters so that if you have multiple drill downs to the same page, it clears out all the filters by default first?

    1. I’m not sure what you mean by “do the same thing in drill through”. Drill through will take you to a new report page. You can format that page as you like, the filters will be passed to the new page, and hence the concept of testing for the existence of a filter should still work.

  19. I want hide a report page. If there is no data. I mean in my case it may happen some time data will come some time it will not. So whenever there will be no data how to hide a the visuals?

  20. Slicer values: Week, Month, Quarter

    3 graphs are present in same page
    1.Bar chart 2.Line Chart 3.Tree Map

    Requirement is:
    when user select Week in SLICER then display only1.Bar chart and 2&3 graph should hide
    when user select Month in SLICER then display only1 2.Line Chart and 1&3 graphs should hide
    when user select Quarter then display only1 3.Tree Map and 1&2 should hide

    1. Hi Raju,
      If I understand your scenario correctly, then you will need to make separate measures for the separate show/hide conditions.

  21. does the same work for a table visualisation ?I am using the text filter from the app store -and the check fiklter does not seem to work for this …

    1. I couldn’t get the nice trick to work with the table visualization either. I had a master table and a child table and I wanted to show no data on the child table unless I click on a row in the master table. In the Check Filtered measure, I had to test different columns of the master table ISFILTERED(MasterTable[FindTheRightColumnHere]) and all of a sudden it worked. I hate to not understand the reason but it is working now.

  22. Hi ,
    I have almost a similar requirement.
    Requirement : When I select a button only the specific visual has to change (this one I can do with bookmarks)
    I have 2 visual independently (and 2 on exactly on top of them)
    I have four buttons , 2 on top of each visual
    button1chart button2table
    ——-chart visual—-
    ——-table visual———
    button3chart button4table
    —–chart visual—————–
    ——table visual———————-
    Now when I select button2table , the chart visual should change to table
    After this when I select button4table , the chart visual should change to table (the first visual table should remain table)
    after this , when I select button3chart , the visual should come back to chart (but still the first visual should remain as table).

    It’s like the visual should change independently.
    how can I achieve this ?
    please help
    Note : I have tried bookmarks and selection panes
    But the problem is when I bookmark button4table , I don’t know the above visual is in which state and that state should not change

    Thank you Much Appreciated

  23. how to hide/unhide visuals based on selection (i need to put all visual names in slicer ,then user can select and see visuals which ever he wants , unchecked visual names will be hide)

  24. how to hide/unhide visuals based on selection (i need to out all visual names in slicer ,then user can select and see visuals which ever he wants , unchecked visual names will be hide)

  25. Hi matt, It really worked. Thanks to your article. However I need to use filters instead of slicers to filter things out as slicers makes report so much slow when using with comparitively huge data. Do you have any idea which works the same but with filters?
    Thanks in advance.

    1. Absolutely!
      Set your visuals up the same way, but instead of adding the slicer, simply place the trigger field onto your filters pane.
      It has the same effect.

    1. You can’t use this technique because of the “invisible” box will cover the slicer and hence you can’t click the slicer even when the box is invisible. But it occurs to me you could use DAX to control what options are in the slicer for the user to select. Maybe even an option saying “do X before selecting from this slicer”. If I have time, I may try it out and write a blog.

  26. Hello,
    exactly what I wanted to do (show a line graph only if a line selected in a matrix)
    and done in 10 minutes thanks to you

  27. Thank you for sharing this.
    I have tried this in my report and I downloaded your sample work book as well but noticed that your sample work book has same issue what I am facing. But the final result video above is working fine.
    so when I select the value in the slicer, the message is gone and matrix is displayed but the header (which were hidden behind the card when value was not selected) part is still hidden. Meaning the card is not being transparent to show hidden part when value is selected. Can you help me here what possibly I have done wrong? I followed all the steps above, do you think I had to add any more steps or lines of code to achieve this?

  28. Hi Matt! Thanks for the article. It is very helpful.
    When I try to apply the filter “Filters on this visual” is not working, as the matrix is not recognizing when the Check Filtered vales is 1 or 0. As consequence, is always showing data (Check Filtered always == 1).


    1. I am not sure if you have found the solution, but I had similar situation until I covered up the intended visual with the card having the option of transparent background. In my experience, Check Filtered Measure has no influence and is not needed. Hope this will help.

      1. The Check Filtered Measure is only necessary if you want to have the visual appear blank prior to your selection.
        As you say, this isn’t necessary for the invisible card to work. It is only necessary if you desire to have a visual that can be clicked after the initial selection has been made.

  29. Brent van de Wijdeven

    Hi Matt, thanks for the great article!

    Unfortunately I get stuck at formatting the card. When trying to select the measure as field value –>
    “Click on Conditional formatting, Select Format by as “field value” and then select the measure.” I can’t select any measure there…
    Do you have any idea what might cause this?

    Kind Regards,

          1. Indeed, you need to be careful about the type of the measure, it should be a text. The default type is number and does could be the issue

  30. This show visual option does not work for card and donut chart. when I created a measure to find out if the slicer is selected like isfiltered and when we put this in visual level filter, it became unresponsive. do we have any alternative option for this or I am missing something.

    1. It shouldn’t matter which visual type you are using.
      I have successfully used this technique on donut charts without issue.

      1. Can you please how did you use this technique on donut charts or bar chart? I used that technique, and it is working, but I cannot interact with the visual where I have implemented card. Any idea of how to use it for that?

  31. Hi Matt,
    Can this possible if my visual is Hierarchy slicer . if possible can you mention required changes .

    Waiting for your reply,

  32. Hi Matt, is it possible to made same hiding technique to the below scenario
    As per my requirement, We have 10 visuals in one page( order by : 1 slicer, 5 tree maps, 2 tables , 1 bar chart and 1 line chart) all visuals needs to be appear only based on ealer filter.i tried but its not working as i expected bcz when i press 3rd visual and ot is filtering 4 visual but 3 visual became blank.

    Can you pls help me on that.

    1. Well, conceptually I see no reason why it wouldn’t work for any number of visuals. Of course if you have many visuals dependent on the next visual status, then it starts to get more complex. This then becomes a DAX issue, and as such it can be tricky. My advice is to set up your DAX formulas in a table and test that they do what you want. If you get the DAX right, the rest should be straight forward.

    2. Nagendra, have you got the results

      based on user selection in SLICER then chart should display?

      if you have got the results. then send me pbix file to [email protected]….im also doing the same requirements.

  33. Thank you so much for the article! So simple, clear and works just great! I’ve been looking for the solution for quite a while and so glad I have finally found it!

  34. Another great article, however I want to be able to hide the entire (table) not Matrix based on the slicer. Meaning the area/table should be blank until the selection is made and then the whole table should show just the selection and it’s other details. Is this possible?

    1. Jason Cockington

      Hi Pablo,
      You will need to set your Table up like the Matrix described in the article, with the CheckFiltered measure attached as a filter on this visual, and the Message measure to the card. The card then simply needs to be placed over the header row of the table.
      This will make the entire table appear to be hidden until you select an apropriate visual elsewhere on the report. The only thing you wont be able to select as soon as the table becomes visible is the column headers. If you click elsewhere in the table though, this will bring the table to the front, and then you can click the column headers to sort.

  35. I cannot perform the interactions after this as the card acts as a barrier to the page, How can i make show the error message when no value is selected and the make the card disappear once a value is selected

      1. Hi Matt, Thanks for sharing wonderful trick..But there is a problem when we using more then 3 visuals..
        Can you pls help me on below senero:
        As per my requirement, We have 10 visuals in one page( order by : 1 slicer, 5 tree maps, 2 tables , 1 bar chart and 1 line chart) all visuals needs to be appear only based on ealer filter.i tried but its not working as i expected bcz when i press 3rd visual its bcame blank.

        Can you pls help me on that.

  36. It was all going well until I got to the last step. There is no “…” option in my Background formatting for the card. No idea how to make the “. . . ” appear but conditional formatting seems to not be an option for my version of Power BI Desktop.

    1. Matt Allington

      Ok, so the obvious question is, “what version are you using”? Note, MS made changes in April 2020. The … is now gone and you just need to click on the Fx button

  37. That’s very good explanation , can we add an image to the existing transparent card . the user has to see picture with message in the card and when he selects the filter it has to show the result


      1. Hi Matt,
        Can this possible if my visual is Hierarchy slicer . if possible can you mention required changes .

        Waiting for your reply,

  38. Lambert Marie-Julie

    Hello Matt,

    Thanks a lot, it really helps!

    Basically I’m doing similar things as you : when I select a country the message disappears and graphs are visible. But I have an issue to select or show labels of the graphs that were hidden. It seems that the transparent card does not let me interract with the graphs below it.

    Thanks a lot for your answer,


    Here is the link to the dashboard I created using thes tips:

    1. correct. This solution is simply show/hide what is beneath. Microsoft is working on making every part of Power BI controllable using expression based formatting. Currently there are lots of areas that can do this (including a chart heading) but often it has not been discoverable. This is now fixed. Where ever you can see the Fx button next to an item in the format pane, there you can use expression based formatting. Keep an eye out for the buttons.

  39. Very Clever – its too bad PowerBI doesnt simply have a conditional show option as an attribute of all visuals, instead of needing a kludge (clever as it is) like Qlik has had for over 10 years. Ug.

    1. You can’t compare the feature list of Qlikview (launched in 1994) with Power BI (launched in 2015) and say “Qlik has had this for 10 years”. Microsoft has already announced it is extending expression based formatting everywhere, and it will come.

  40. Hi Matt,

    With regards to “Show or Hide a Power BI Visual Based on Selection”, does it have to be a slicer and another visual or lets say can it be between two visuals (e.g. two tables)?

    Thank you

    1. Jason Cockington

      Hi Violet,

      The short answer is: No, it doesn’t need to be a slicer.

      Longer answer is, it depends what you’re trying to do.

      Let’s say I have two visuals I want to hide/appear based on selections.
      The first is a column/line chart showing Total Sales by Country and Region.
      The second is a table showing Total Sales by Country & Region.

      I want both visuals to appear based on a selection of either Customer[Occupation] or Territory[Group].

      I can set up slicers to select either Occupation or Group, but I could also use for example, a Pie Chart of Total Sales by Territory[Group], or a Matrix with Customers[Occupation] on rows and Total Customers on values to the same effect.
      The critical element here is that I need to change my default visual interaction behaviour in the report from Cross Highlighting to Cross Filtering to engage the hide/unhide interactions correctly. If this isn’t set correctly, then the selection visuals won’t impact the hidden line chart correctly. The hidden table will be fine, because cross filtering vs highlight filtering makes no difference to a table, but it does impact how columns are displayed, and thus we need the selection visuals to act as slicers and apply a filter across the page.

  41. Thanks for this! i managed to add it to my report and it works great except for the gauge graphs. Can you help me with this?

  42. Hello Matt,

    Thanks for your article, it’s really useful and well thought !

    I have a challenge about it and i’ve been searching a solution for days without success.
    So basically I’m trying to do the same as your example with a few differences :

    – I have 2 slicers that must influence the message and the blank visual : Country & Customer
    – The visual is a “line and clustered column chart” with 2 categories (Country & City) in the shared axis (they’re linked by a drilldown, Country > City )

    So i created these 2 measures :
    1) Message = IF(
    OR(ISFILTERED(Country); ISFILTERED(Customer)); “”;
    2) Check Filtered =
    ISFILTERED(Customer)); 1 ; 0)

    Until there, it worked perfectly, but I started experiencing issues with the visual, it won’t become transparent when there are two categories (Country & City) in the shared axis field, or only Country in the field for instance.

    Any idea about the cause of this isssue and how to solve it ?

    Is it because the category “Country” can not be the filtering/blank condition while being an axis of the chart ?

    Thanks in advance,

    1. Jason Cockington

      Hi Max,
      The problem with your working is that your chart axis is using the same column of data as your CheckFiltered measure. As a result, your CheckFiltered measure is effectively always selected, and thus cannot hide the chart as intended.
      Are you able to work with an additional column of data within your Territory table, say Territory[Region]?
      For this to work, Territory[Region] would need to have the necessary data to allow a differentiation to the appropriate countries when the chart materialises from a Customer[Name] selection on the slicer.
      I have included an example solution in this workbook.

  43. Hello, your solution looks great! and it’s exactly what I need, however I can’t use “checkfiltered” measure as a filter on my card (or any) visualization, would you have any idea why?

    Thank you!

    1. Jason Cockington

      Hi Rita,
      You can’t use the “CheckFiltered” measure on a card because a card only displays a single value, and thus can’t be filtered.
      The “Message” measure goes onto the card, and the card background is formatted with the “Make Transparent” measure.
      The “CheckFiltered” measure goes onto the chart/matrix you wish to hide.
      Hope this helps.

  44. It’s all clever stuff…….but the key thing I think when reading this (as someone who uses Power BI, Tableau and Business Objects) is why on earth is there not a native hide function in Power BI?! Personally, I find PBI to be a distant 3rd to the other tools I mentioned.

    1. The answer is simple: Power BI is 4 years old, Tableau is 16 years old and Business Objects is 26 years old. I am sure Power BI will have a native hide function in the future as Microsoft continues to develop the product over the years ahead.

  45. Hi Matt,
    This solution worked great for me. I have a quick question, though. I am using this solution to mask a bar chart until a selection is made. However, I think because it covers the bar chart area, I am losing the “mouse over” tool-tip information on the bars in the chart. Do you know of a way to stop this from happening?


    1. Hi Shannon,
      The challenge you have here, is that you are trying to hide the entire chart until a selection is made.
      The solution to give you this effect, but still allow you to maintain interactivity with your bars, is to only hide the elements of the blank Bar Chart, prior to selection.

      1. Write an additional Message measure, that renders a blank card

      Message Blank = 

      2. Apply formatting to Message Blank card:
      – remove category label
      – conditionally format background colour with Make Transparent measure, as you did with your original Message card.
      3. Resize your original Message card to just cover the Bar Chart Title, and place a Message Blank card over each of the axis of your chart, so that the space where the bars render remains uncovered.

      Now, when nothing is selected in your slicer, you will see your message. Then when you select a value in your slicer, the Message card and the Message Blank cards will become transparent, so your Bar Chart will appear to have materialised based on the selection, and your bars will remain fully interactive, allowing you to mouse over for tool-tips, or click a bar for cross-filtering.

  46. Hi, I created all the measures as per the instructions here. I have 4 filters which I need to have selected for a visual to appear or become active. the check Filtered and the Message work fine, however I am not able to select the Make Transparent measure as a field in the background color conditional formatting options. It seems to be grayed out. any idea why?

  47. Hi Matt, This is great! Can you help me with my situation where in I have a bar chart for annual revenue with 7 bars by the top 7 clients and I only wish to highlight and display the name of the selected client from a filter, while not revealing the names of the other 6 clients, but showing their revenue stats?

    1. For customer presentations? I can’t think of any way to selectively show or hide one of the labels. I think you may have to turn off the labels for customer and add a manual text box. I guess yo could add 7 text boxes manually, and conditionally for at each of them to have the text transparent or black. Or maybe create 7 blank cards and control which of them are shown or hidden. You would have to manually place them over the customer names however, and that would be an issue if the chart redraws.

  48. Hi Matt, Thank you for the suggestion. I tried it and i was able to successfully hide a visual. But can you help me acheive the same functionality if i click on a scatter plot instead of filtering? I have a functionality where in i click on a data point in a scatter plot, i need to unhide the visual

  49. Hello Matt,

    Thank you for your interesting solution.

    I have tried to use it, but I faced with the following problem.
    The matrix(table) has no react on the filter “Check filtered”, being included in “Filters on this visual”.
    Moreover, if I change the values “0” and “1” in “Check filtered”, the matrix will be hidden forever without any reaction to check boxes.
    The picture of the described case is available by the link on

    Thanks in advance for any help!

    1. Jason Cockington

      Hi Sergi,

      Looking at your image, it appears you have placed the Check Filtered measure onto your card.
      You need to place the measures as follows:
      1. Message – onto card fields
      2. Make transparent – onto card background, conditional formatting, field value
      3. Check filtered – onto matrix, filters on this visual

      If you’re still having trouble, check out this how-to video if you’re still having trouble.

      1. Hello Jason,
        I am having the same problem as Sergei. What he showed in the image is that if the filters is selected or not, it is showing data (not hiding the results of the matrix).
        If Check filtered == 0 the matrix is showing data. If Check filter is = 1, the matrix is showing data.
        Would you know why it is not getting applied the filter in visualization filters?
        Thanks in advance,

  50. Hello, I’m having an issue with the Check Filtered measure – when I add this into “Filters on this visual” I can’t interact with it at all? it doesn’t seem to let me add any visual filters onto it, the drop down menus don’t populate and I can’t click in the boxes to enter text.

    1. Hi Jace,
      Just double checking that you are placing the Check Filtered measure onto the Matrix and not the card.
      You can’t interact with measured filters on cards. If you click on the Message measure that is on the “Filters on this visual” of the card, you are not able to adjust its settings at all.
      In order to render the Matrix blank, it is the matrix that needs to be filtered by the Check Filtered measure.

      Check out this how-to video if you’re still having trouble.

      1. Thanks Jason,

        I had originally shown this as a card however I realised this was a limitation and changed it to a matrix, however I have just one measure in this under values and nothing in rows/columns – will this be the reason I can’t add a filter?

        1. Jason Cockington

          Hi Jace,

          Yes, that’s right. You need to have at least two values in the visual you are trying to hide (filter) with the Check Filtered. It doesn’t have to be a matrix, it could be a pie chart, column chart, or anything that takes at least two field values to display correctly.
          If you place something onto the rows, then the Check Filtered measure will work.

          If your target visual only requires the one value, and you just want to show or hide that, then skip the Check Filtered steps (skip: Write Check Filtered Measure & Filter Matrix to Render Blank), and just place the Message card over the entirety of the visual you are trying to hide.

  51. Jason Cockington

    Combining Matt’s solution with Maxim’s [Check Filtered] measure, allows for a more interactive experience for some visuals.
    With Matt’s matrix example, rather than covering the entire matrix with the message card, one only needs to cover the top two rows (those that would display when the matrix is blank thanks to [Check Filtered]).
    Then when the slicer is active and the card becomes transparent, it is possible to interact with the rest of the matrix and further cross-filter the report.

  52. Good solution, but the problem with it is that the card retains foreground focus and the control underneath is basically inoperable: no hover, selection, cross-filtering, …
    Anybody have a fix for that? AFAIK, the Z-order for visuals doesn’t change at run-time.
    The best I can come up with is covering options with bookmarks (no drop-downs obviously) and bookmarking the selection. Ugh.

      1. No kidding…this has been a thing in Qlikview (the old tool of choice at my company) for over a decade. I hope they implement it soon.

  53. Hi Matt,
    I have one challenge in our BI reporting.
    I have sales 1, sales 2, customer1, customer 2, item1, item 2 , date, sales lines 1, sales line2, sales history table
    Sales 1 joined with Sales lines 1 and Item 1 table. Sales line1 joined with date and customer 1 table
    Sales 2 joined with Sales lines 2 and Item 2 table. Sales line2 joined with date and customer 2 table
    Sales History joined with all the customer, item and date table.

    Have to combine Sales 1 & Sales 2 and sales history and report on this.
    What i did is: appended sales 1 and sales 2
    appended customer 1 and customer 2
    appended item 1 and item 2
    appended Sales line 1 and sales line 2
    Joined with the fact tables with respective dims above
    1st challenge: while joining the Sales history with Customer (Appended) i couldn’t make it active (seems data granularity issue)
    2nd challenge: sales history having the data until may 2019 remaining facts have data from June 2019.
    I used fiscal month as slicer. Since i couldn’t join the customer table when i use customer name and total sales from all 3 facts) the measure is not giving proper result.
    I would like to use different Customer copies one for Sales history and other for Sales table. and i want to choose customer name from either customer table joined to sales or customer table joined to sales history. Is that possible. also let me know is there any other alternative to face this issue.

  54. Hi Matt,

    I have a scenario when I have three constant lines (they do not come from Analytics) but rather a data columns (temperatures like extreme heat, comfortable low, comfortable high). On my slicer I have weather attributes (temperature, humidity, wind and pressure). I only want to display the three lines if the Temperature is selected. They do not belong to other attributes. How do I make them transparent? I can do any conditional formatting under the Data colors.


    1. The IF construct allows you to control 2 outputs; a null string or a custom message. SELECTEDVALUE will allow you to control one output only, with the other output being the value in case there is a single selection. I wanted to control both items. Yes you could use SWITCH(TRUE()), but that seems over kill unless you need more than 2 outputs

  55. Hi Matt.
    Solution work great, but there is one issue: if i want to hide matrix table, and show only if filterred, matrix table is not clickable (stepped layuot) or cant export to excel. The problem is that transparent visual is over matrix table, and that’s why user cant click on matrix table.
    Is it possible to solve it?

    1. Yes, that is the issue. I don’t know of anyway to solve this particular problem. In the future I would expect that expression based formatting will solve the problem but as of today I don’t know of a solution

      You could take a different approach however. it is already possible to use expression based formatting to set the background colour of objects. I am not 100% sure but I think you can do this with a matrix and table (you definitely can with cards), you would have to check. So one idea would be to set the background colour of the matrix to be read if it is not correctly configured. Another approach would be to set the title of the chart to give a message instructing the user to select a value first

  56. Cool and clever approach, but the transparent card gets in the way of interacting with the underlying visual. 🙁

  57. Hi Matt,

    Here is my solution:
    Check Filtered = IF(ISFILTERED(Products[Category]),1,0).

    Place the measure to Filters on this visual tab and in Show items when the value: is 1

    Hope it helps anyone.

  58. Hello Matt,

    I experimented with your hack to show or hide some menu buttons based on certain values in a table, to restrict access to certain pages in my report
    But one problem: if the button is visible and the transparancy is on of the card or shape (rectangle) that’s used to hide the menu-button, it’s not possible to use the click to another page , because you’re still clicking on the card that’s used to hide the button, and not the button itself.
    It’s the same if you hide for example a chart or table, it’s not possible to click in it to filter another visual

    Have you experienced the same problem and have maybe (hopefully) a solution?

    1. Yes, you are right – I found this too. In my example you can’t select the visual hidden then shown for the same reason. I realise my concept is a hack and it has some limitations. Microsoft has announced that it will continue to build out expression based formatting across the product. So I hope and expect that at some stage we will be able to use a measure to make any visual visible or not

    2. Hi, in my case I wanted to hide a table. The scroll wheel didnt work when it was fully placed over the table but when I leave a bit of space on the right side it does work when the white space is gone. Might help with your problem aswell if you tried to scroll on your visual.

  59. Hi Matt,

    Great article, I am uunable to locate ellipses on the right-side of Color on card visual. I am using May 2019 release of PowerBI

  60. Simon Schofield

    Hi there, is there a way to amend the ‘Make Transparent’ measure so that when a certain value is selected from the slicer the transparent treemap is activated, rather than no value being selected from the slicer. Cheers

  61. Hello! A great tip, thanks for it!! Do you think the same would be possible if one bar in a bar chart is selected. With that I mean if a user would click on a bar, more details would appear (the treemap would become transparent) depending on the selection of the bar. (each bar has a unique ID).
    Thanks million times!

    1. You would have to test it. I am expecting more expression based formatting to come to Power BI in the future, so hopefully at some stage this will be a feature rather than a hack.

  62. My guess is that you have cross filtering set to “highlight”. If that is the issue, change “edit interactions” to “filter”. It is on one of the menus visible when you select the matrix.

  63. Hi, Instead of Slicer selection, I tired with Matrix row selection. With the Matrix row selection, I am not able to achieve the same thing. Could you please let me know how to use with Matrix row selection (SelectedValue) instead of a Slicer? Thank you in Advance.

  64. Pete Watridge

    Hi Matt — really enjoy your articles — have your website on my regular “to read” list. Your insight of using Treemap as a controllable color shape was brilliant and an eye opener for me. I had a project where I needed the background color of a matrix to be controlled by filters. So I adapted your approach: I made the background of the grid 100% transparent — and then put the treemap “background” behind it that responded to the filters via DAX formula. It worked perfectly. Never would have thought of using treemap as a controllable background without this article. Many thanks!

  65. Dang: This doesn’t work for me when saved to the PBI service and rendered in IE (version 11.0.120).
    Works fine in chrome. But our users have IE as the default.

    Anyone manage to get it working in IE?

  66. Hey Matt…I just spent ages trying to replicate your trick to no avail, until I finally realised that I was trying to trigger it from a Table (not a Slicer) and the default behaviour was to crossfilter the Treemap rather than filter it. Meaning it didn’t work. Perhaps you could include another step in your instructions above showing how to change the “Edit Interactions” behaviour of the TreeMap from Crossfilter to Filter, so this cool trick can be used for other types of trigger visuals.

    But I love it, man.

    1. Another way to accomplish this is to use visual level filters combined with dynamic titles. Create a measure that is 1 if filtered, 0 if not. Drag that measure to filter pane and set to only show when measure=1.

      You can also use that measure within the dynamic title to have it display a message. I use this for data tables when I don’t want all of the information showing until a user has filtered it.

      1. @Stu I use that trick too. But this method of obscuring both the data and the headers means you can do additional stuff like overlay different types of visuals on top of each other, and trigger a bookmark-like experience from a Slicer, which is very cool (and should be allowed natively).

  67. Is it possible to do the trick on two slicers with an OR function or similar? So the message would disappear if one selected the first slicer or if they just selected the second slicer?

  68. Hi Matt – Great Article, when i was experimenting with the file i realized that instead of writing the hex code for transparent as #FFFFFF00, one could just write “transparent” and it works.

  69. Could this work to highlight a sub-group in a scattergram? i.e. make the unselected sub-groups more transparent than the selected one.

    1. The principle of a measure that formats a data point is the same, I think. So as long as you can write the DAX, you will be able to do what you suggest. But what you will need to do is have your slicer either with an inactive relationship, or no relationship at all, otherwise the slicer will filter the visual. I assume that changing the cross filter behaviour between slicer and visual will not work in this case, but I can’t be sure.

      1. Great thanks, I solved it as you say by overlaying two scattergrams with the same set axes and one which has an inactive relationship to the slicer

  70. This is awesome Matt! I’ve been trying to find a way to do this as well, the treemap approach is pretty brilliant.

    One thing to note regarding optimization: the matrix is still calculating even though you can’t see it. That means a potentially large DAX query is still running in the background…possibly slowing down other visuals.

    You may want to adjust your matrix measure to the following:
    [Matrix Measure with Check] :=
    ISFILTERED( Products[Category] )
    ,[Matrix Measure]

    This will return BLANK() if there’s no selection, saving the other measure from being evaluated.

    1. Yes, this would be another approach. I was really trying to find a problem to match my solution – the idea of using transparency to hide or show an object on the canvas. I am sure my solution has other applications too. For example, you could create an instructions section on the page, and overlay multiple text boxes with multiple instructions, all set to transparent text and transparent background. When certain conditions are met, you could display the appropriate instruction by changing the transparency.

  71. Nice workaround. Coming from the Qlikview world and having used that for the past 8 years, it’s amazing to me that simple SHOW/HIDE conditions are not available yet in PBI. This conditional formatting they are starting to roll out makes me feel like they are starting to get it and PBI is getting more and more Qlik like with every release.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top