Forum

Notifications
Clear all

Trying to hide a table when no slicer is selected

10 Posts
2 Users
0 Reactions
559 Views
(@robbieg)
Posts: 39
Trusted Member
Topic starter
 

I have a table that is being filterred by 2 slicers. The two slicers are connected. I want to hide the contents of the table when no selection is made.

The slicers are 'Category' and 'Sub Category' (named Service).
I have created a measure to do that and it works if no selection made in the first slicer (Category). But I want to hide the table until a selection is made in the second slicer. If I apply a similar measure for the second slicer then that doesn't hide the table.

I have attached the file in question.

The measures are 'Category Filtered' and 'Services Filtered'. If I apply 'Category Filtered' to the table, then the table is not displayed if no categories are selected. However, if I apply 'Services Filtered' to the table, the table is always displayed.

Can anyone advise please?

Thank you

 
Posted : 07/05/2024 12:23 pm
Riny van Eekelen
(@riny)
Posts: 1200
Member Moderator
 

Neat feature you are using here and I hope I've understood it correctly. Remove Service from  the main table, but include Category. This will 'hide' the main table until something is selected in the Service slicer.

 
Posted : 08/05/2024 2:33 am
(@robbieg)
Posts: 39
Trusted Member
Topic starter
 

Thank you, Riny.

Yes - that works, but it's the services that I am wanting to show in the table rather than the categories!

 
Posted : 08/05/2024 4:08 am
Riny van Eekelen
(@riny)
Posts: 1200
Member Moderator
 

Then I can't help you I'm afraid. Perhaps someone else.

 
Posted : 08/05/2024 5:24 am
Riny van Eekelen
(@riny)
Posts: 1200
Member Moderator
 

Had another look at it. What if you put both the Category and Service 'is filtered' on the visual?

Nothing selected in Category will hide the table and the Service slider buttons.

Select a Category and the table will show all for that category and the Service slicer becomes visible.

 
Posted : 08/05/2024 5:48 am
(@robbieg)
Posts: 39
Trusted Member
Topic starter
 

Thank you for looking again, Riny

Yes, (I think) I've tried that also, but I don't want to show all the services in the table. I need to wait until one has been selected in the slicer and just display that.

I've tried:

IS FILTERED = INT( (ISFILTERED(dimCategories[Category]) &&  (ISFILTERED(dimServices[Service]))))
and applying that to the table visual but aslo displays the table after the Category has been selected.

 

Are you suggesting something different?

I've also looked at adding a button to press before the table is displayed (unhidden!) but there isn't an on_click type function for buttons. 

I'm now looking at adding a 'button' via a new slicer with 'Apply' and 'Clear' and using the SELECTEDVALUE to trigger the filter. Since that field won't be in the table, I'm thinking it might work!

 

Thanks

 
Posted : 08/05/2024 6:21 am
Riny van Eekelen
(@riny)
Posts: 1200
Member Moderator
 

I ran out of ideas. Sorry.

 
Posted : 08/05/2024 6:34 am
Riny van Eekelen
(@riny)
Posts: 1200
Member Moderator
 

Yet again, I had another idea!

Create a calculated column in dimServices, called Svc, for example:

Svc = if( [Services FIltered]=1, dimServices[Service], blank())
 
Then use Svc in the visual for the table and put the filters back as you had them.
 
Posted : 08/05/2024 6:57 am
(@robbieg)
Posts: 39
Trusted Member
Topic starter
 

Brilliant logic! Thank you, again, Riny.

Best wishes

 
Posted : 08/05/2024 7:23 am
Riny van Eekelen
(@riny)
Posts: 1200
Member Moderator
 

It took a while, but glad we figured it out.  

 
Posted : 08/05/2024 7:47 am
Share: