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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

create new visuals for each selection in a slicer

Hi, I need help figuring out how to best fulfill this requirement: I have a multiple select slicer and a visual. If the user selects more than one item in the slicer, for each new selection, I would like there to be an additional visual that is filtered only by the added selected item, i.e. I do not want one visual that is sliced by the entire selection in the slicer, but rather one visual for each selected items (and filtered by that item only). Any chance to do so without creating separate slicers for each visual?

1 ACCEPTED SOLUTION

Hi @Anonymous 

Your requirements are:

1. Only need a slicer.

2. If there is only one selection in this slicer, there will be only one visual filtered by this selection.

    If there are multiple selections, power bi will create multiple visuals and each visual show values filtered by one of the selections.

Currently, power bi doesn't support to build visuals automatically to show values filtered by each selections when you select multiple filters in slicer.

I think you can try to build visuals manually and build some measures to filter the visuals to show values filtered by one of the selections in each visual.

My Sample:

1.png

Build a calculated table.

 

Slicer = VALUES('Table'[Category])

 

 Use this table to build a slicer.

There are three selections in my slicer.(A,B,C) So I will build three visuals and build three measures to filter each visual one by one.

 

Filter 1 = 
VAR _SEL =
    VALUES ( Slicer[Category] )
VAR _Count =
    COUNTROWS ( _SEL )
RETURN
    IF (
        ISFILTERED ( Slicer[Category] ),
        IF (
            _Count = 1,
            IF ( MAX ( 'Table'[Category] ) IN _SEL, 1, 0 ),
            IF (
                MAX ( 'Table'[Category] )
                    IN _SEL
                        && MAX ( 'Table'[Category] ) = "A",
                1,
                0
            )
        ),
        1
    )
Filter 2 = 
VAR _SEL =
    VALUES ( Slicer[Category] )
VAR _Count =
    COUNTROWS ( _SEL )
RETURN
    IF (
        ISFILTERED ( Slicer[Category] ),
        IF (
            _Count = 1,
            0,
            IF (
                MAX ( 'Table'[Category] )
                    IN _SEL
                        && MAX ( 'Table'[Category] ) = "B",
                1,
                0
            )
        ),
        0
    )
Filter 3 = 
VAR _SEL =
    VALUES ( Slicer[Category] )
VAR _Count =
    COUNTROWS ( _SEL )
RETURN
    IF (
        ISFILTERED ( Slicer[Category] ),
        IF (
            _Count = 1,
            0,
            IF (
                MAX ( 'Table'[Category] )
                    IN _SEL
                        && MAX ( 'Table'[Category] ) = "C",
                1,
                0
            )
        ),
        0
    )

 

Add Filter 1 in filter fields in left visual ,Filter 2 in filter fields in mid visual, Filter3 in filter fields in right visual.

And set them to show items when the value =1.

Result:

By default left visual will show all values.

1.png

Only one selection in slicer. It will show values filtered by selection in left visual. Other visuals will show blank.

2.png3.png

Multiple selections. Left visual will show values filtered by A, Mid visual will show values filtered by B, and last one show values filtered by C.

5.png

You can download the pbix file from this link: File

 

Best Regards,

Rico Zhou

 

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

3 REPLIES 3
Anonymous
Not applicable

Thank you. I'm aware of the edit interaction option. However, e.g. in case of two selected items, I want that one slicer where they are select to interact with both visuals - it is the way of interacting that bothers me. Instead of it filtering both visuals by both items, I would like one visual to be filtered only be one selection and the other one only by the other selection.

Hi @Anonymous 

Your requirements are:

1. Only need a slicer.

2. If there is only one selection in this slicer, there will be only one visual filtered by this selection.

    If there are multiple selections, power bi will create multiple visuals and each visual show values filtered by one of the selections.

Currently, power bi doesn't support to build visuals automatically to show values filtered by each selections when you select multiple filters in slicer.

I think you can try to build visuals manually and build some measures to filter the visuals to show values filtered by one of the selections in each visual.

My Sample:

1.png

Build a calculated table.

 

Slicer = VALUES('Table'[Category])

 

 Use this table to build a slicer.

There are three selections in my slicer.(A,B,C) So I will build three visuals and build three measures to filter each visual one by one.

 

Filter 1 = 
VAR _SEL =
    VALUES ( Slicer[Category] )
VAR _Count =
    COUNTROWS ( _SEL )
RETURN
    IF (
        ISFILTERED ( Slicer[Category] ),
        IF (
            _Count = 1,
            IF ( MAX ( 'Table'[Category] ) IN _SEL, 1, 0 ),
            IF (
                MAX ( 'Table'[Category] )
                    IN _SEL
                        && MAX ( 'Table'[Category] ) = "A",
                1,
                0
            )
        ),
        1
    )
Filter 2 = 
VAR _SEL =
    VALUES ( Slicer[Category] )
VAR _Count =
    COUNTROWS ( _SEL )
RETURN
    IF (
        ISFILTERED ( Slicer[Category] ),
        IF (
            _Count = 1,
            0,
            IF (
                MAX ( 'Table'[Category] )
                    IN _SEL
                        && MAX ( 'Table'[Category] ) = "B",
                1,
                0
            )
        ),
        0
    )
Filter 3 = 
VAR _SEL =
    VALUES ( Slicer[Category] )
VAR _Count =
    COUNTROWS ( _SEL )
RETURN
    IF (
        ISFILTERED ( Slicer[Category] ),
        IF (
            _Count = 1,
            0,
            IF (
                MAX ( 'Table'[Category] )
                    IN _SEL
                        && MAX ( 'Table'[Category] ) = "C",
                1,
                0
            )
        ),
        0
    )

 

Add Filter 1 in filter fields in left visual ,Filter 2 in filter fields in mid visual, Filter3 in filter fields in right visual.

And set them to show items when the value =1.

Result:

By default left visual will show all values.

1.png

Only one selection in slicer. It will show values filtered by selection in left visual. Other visuals will show blank.

2.png3.png

Multiple selections. Left visual will show values filtered by A, Mid visual will show values filtered by B, and last one show values filtered by C.

5.png

You can download the pbix file from this link: File

 

Best Regards,

Rico Zhou

 

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

 

Anonymous
Not applicable

@Anonymous use formatting options, select the slicer and go to formatting and turn off the interaction you dont want for the visuals.
https://windowsreport.com/turn-off-interactions-power-bi/

follow above 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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