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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
monishd
Frequent Visitor

Is there a way to have only "Select all" and one of the options shown in the PowerBI slicer?

I have a slicer with two options: TRUE or FALSE. I want to show only options "Select All" and "FALSE." When false is selected, the data for FALSE is shown, and when "Select All" is selected, data for both true and false are shown in the table.

1 ACCEPTED SOLUTION
v-fenling-msft
Community Support
Community Support

Hi, @monishd 

Since you didn't give specific data to test, I assumed a simple data set myself: 

vfenlingmsft_4-1724916147619.png

 

You can then create a SlicerTable first via New Table like bhanu_gautam : 

vfenlingmsft_5-1724916147620.png

 

SlicerTable = 
DATATABLE ( "Selection", STRING, { { "Select All" }, { "FALSE" } } )

 

 

Then create a simple Measure: 

 

FilterMeasure = 
IF (
    SELECTEDVALUE ( SlicerTable[Selection] ) = "FALSE",
    IF ( MAX ( 'Table1'[Result] ) = "FALSE", 1, 0 ),
    1
)

 

 

Finally drag the created Measure to the Filter panel and set the filter condition to 1. This is the final result: 

vfenlingmsft_6-1724916163903.png

 

vfenlingmsft_7-1724916163907.png

 

The pbix file for this example has been put at the end, I hope you find it helpful! 

 

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
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

2 REPLIES 2
v-fenling-msft
Community Support
Community Support

Hi, @monishd 

Since you didn't give specific data to test, I assumed a simple data set myself: 

vfenlingmsft_4-1724916147619.png

 

You can then create a SlicerTable first via New Table like bhanu_gautam : 

vfenlingmsft_5-1724916147620.png

 

SlicerTable = 
DATATABLE ( "Selection", STRING, { { "Select All" }, { "FALSE" } } )

 

 

Then create a simple Measure: 

 

FilterMeasure = 
IF (
    SELECTEDVALUE ( SlicerTable[Selection] ) = "FALSE",
    IF ( MAX ( 'Table1'[Result] ) = "FALSE", 1, 0 ),
    1
)

 

 

Finally drag the created Measure to the Filter panel and set the filter condition to 1. This is the final result: 

vfenlingmsft_6-1724916163903.png

 

vfenlingmsft_7-1724916163907.png

 

The pbix file for this example has been put at the end, I hope you find it helpful! 

 

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

bhanu_gautam
Super User
Super User

@monishd ,Create a Disconnected Table for the Slicer:
Go to the "Modeling" tab and select "New Table."
Create a table with the values you want in the slicer:
DAX
SlicerTable = DATATABLE(
"Selection", STRING,
{
{"Select All"},
{"FALSE"}
}
)
Create a Measure to Control the Data Display:
Create a new measure that will control the data display based on the slicer selection:

DisplayData =
VAR SelectedValue = SELECTEDVALUE(SlicerTable[Selection])
RETURN
IF(
SelectedValue = "Select All",
1,
IF(
SelectedValue = "FALSE" && [YourColumn] = FALSE,
1,
0
)
)

 

Apply the Measure to Your Visual:

Add the measure to the visual-level filters of your table.
Set the filter to show items where DisplayData is 1.
Add the Slicer to Your Report:

Add a slicer visual to your report and use the SlicerTable[Selection] column.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.