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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

A solution for the "ISFILTERED() SELECT ALL" Problem

Dear Community,

 

with reference to the below attached link, the ISFILTERED() command works like a charm with one serious limitation: if you "select all", the command will return as if no value is selected. Hence a command like the following is not working in such a scenario:

 

Measure1 =
CALCULATE ( IF ( ISFILTERED ( Table[Column] ), 1, 0 ), ALLSELECTED ( Table ) )

Is there a solution to this problem from your perspective?

 

Note that @pborah has raised this question already in the attached link, but since it was burried in the comments where no attention was drawn to it yet and since multiple users have problems with it, I thought it's time for swarm intelligence via opening a seperate topic.

 

Reference:

https://community.powerbi.com/t5/Desktop/Show-blank-when-nothing-is-selected-in-the-slicers/td-p/659...

 

Best

Isidor

1 ACCEPTED SOLUTION

Hi @Anonymous ,

Based on your description, you can create a slicer table using this formula, use it as a slicer:

Slicer table =
UNION ( ROW ( "Country", "Select all" ), DISTINCT ( 'Table'[Country] ) )

Create this measure, put it in a visual filter and set its value as 1:

Measure = 
IF (
    ISFILTERED ( 'Slicer table'[Country] ),
    IF (
        SELECTEDVALUE ( 'Slicer table'[Country] ) = "Select all",
        1,
        IF (
            SELECTEDVALUE ( 'Table'[Country] ) IN DISTINCT ( 'Slicer table'[Country] ),
            1,
            0
        )
    ),
    0
)

without select any slicerwithout select any slicerselect single or mul slicersselect single or mul slicersselect allselect all

Attached a sample file in the below that you can refer, hopes to help you.

 

Best Regards,
Yingjie 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

5 REPLIES 5
amitchandak
Super User
Super User

@Anonymous , First of all why there is a need to use all selected here.  If I am using all selected with only isfiltered , what is remained to be filtered? 

 

Allselected needs to be part of measure and isfiltered can return such measure

Anonymous
Not applicable

Dear @amitchandak ,

 

how would such a measure look like?

 

Thanks

Anonymous
Not applicable

Dear @amitchandak ,

 

If I understand you correctly, you want to know why use the "Select all" option in the first place, so first of all let me specify the problem further, imagine you have a bunch of countries, and if you have selected nothing, you don't want the table or visual to show anything. In the below case with two countries there is no real necassity for  the"Select all" button, but imagine you have 20-30 countries, and at the same time you want

1. see nothing when nothing is selected

2. have possibility to view single countries

3. but if you want to view all countries as a whole, selecting all of them single handedly can cause pain in the finger, without the select all option to click.

 

Best

Isidore

Hi @Anonymous ,

Based on your description, you can create a slicer table using this formula, use it as a slicer:

Slicer table =
UNION ( ROW ( "Country", "Select all" ), DISTINCT ( 'Table'[Country] ) )

Create this measure, put it in a visual filter and set its value as 1:

Measure = 
IF (
    ISFILTERED ( 'Slicer table'[Country] ),
    IF (
        SELECTEDVALUE ( 'Slicer table'[Country] ) = "Select all",
        1,
        IF (
            SELECTEDVALUE ( 'Table'[Country] ) IN DISTINCT ( 'Slicer table'[Country] ),
            1,
            0
        )
    ),
    0
)

without select any slicerwithout select any slicerselect single or mul slicersselect single or mul slicersselect allselect all

Attached a sample file in the below that you can refer, hopes to help you.

 

Best Regards,
Yingjie Li

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

 

How to put select all option on the top 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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