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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

slicer hide and show based on blank and values

Hi Guys, Need help on this..
 1. if slicer has the blank() and values , then slicer should show
2. if slicer has the only blank , then slicer should hide(slicer should not show)
3. if slicer has the values then slicer should show

1. Notes-3 slicer Should  show- because , it has Blank and Values.                 

Bajigntrr_0-1728456030248.png    
2. Notes-4 slicer Should Hide  - Because , i have only blank value

Bajigntrr_1-1728456079743.png

3. Notes -5 slicer Should not hide (Should show) - becasue , i have the data 

Bajigntrr_2-1728456263625.png

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thank you Kedar_Pande 

Hi, @Anonymous 

According to your description, I have the following data sets and table relationships:

vjianpengmsft_0-1728526555183.png

vjianpengmsft_1-1728526563862.png

vjianpengmsft_2-1728526583429.png

First, I created two slicers:

vjianpengmsft_3-1728526619944.png

I then created two measures using the following expressions:

SlicerA = IF(COUNTROWS(VALUES(TableA[A]))=0,"#FFFFFF","#000000")
SlicerB = IF(COUNTROWS(VALUES('TableB'[Slicer]))=0,"#FFFFFF","#000000")

Use them in the slicer header:

vjianpengmsft_4-1728526735609.png

vjianpengmsft_5-1728526746140.png

The results are as follows:

Have values: show

vjianpengmsft_6-1728526778019.png

Have values and blank() : show

vjianpengmsft_7-1728526821084.png

Only have blank() : hide

vjianpengmsft_8-1728526848358.png

 

vjianpengmsft_9-1728526872627.png

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hi Folks, Any help regarding the above ask

Anonymous
Not applicable

Hi, @Anonymous 

You can refer to the PBIX file I provided, it will achieve your needs.

 

 

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Thank you Kedar_Pande 

Hi, @Anonymous 

According to your description, I have the following data sets and table relationships:

vjianpengmsft_0-1728526555183.png

vjianpengmsft_1-1728526563862.png

vjianpengmsft_2-1728526583429.png

First, I created two slicers:

vjianpengmsft_3-1728526619944.png

I then created two measures using the following expressions:

SlicerA = IF(COUNTROWS(VALUES(TableA[A]))=0,"#FFFFFF","#000000")
SlicerB = IF(COUNTROWS(VALUES('TableB'[Slicer]))=0,"#FFFFFF","#000000")

Use them in the slicer header:

vjianpengmsft_4-1728526735609.png

vjianpengmsft_5-1728526746140.png

The results are as follows:

Have values: show

vjianpengmsft_6-1728526778019.png

Have values and blank() : show

vjianpengmsft_7-1728526821084.png

Only have blank() : hide

vjianpengmsft_8-1728526848358.png

 

vjianpengmsft_9-1728526872627.png

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Thanks @Kedar_Pande , I tried but no luck ,with this measurs , nothing is showing in slicer but not hiding the slicer.. the ask is , it should hide ,, any help ?

Bajigntrr_0-1728457765030.png

 

Instead of visual level filter, you can add conditional formatting to the header and value

Kedar_Pande
Super User
Super User

Create a measure:

SlicerVisibility = 
IF(
ISBLANK(MAX('YourTable'[YourSlicerField])),
"#FFFFFF", "#FFFFFF00"
)

 

  • Option 1: Use a card or KPI visual to show or hide based on the SlicerVisibility measure. You can overlay a blank slicer image or text when the slicer only contains blanks to simulate the hiding effect.
  • Option 2: Apply the measure as a visual-level filter for the slicer, setting the filter to 1 to show the slicer when it contains values and 0 to hide it (or apply an overlay).

 

 

 

Anonymous
Not applicable

I tried Pande conditional formating too but no luck . it is not working .. 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors