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

Filters bases in another filter

Hello all,

 

I'm doing something a page on my dashboard where I want to filter the chart based on a previous selection, see the example below, I have selected a US State (New York) so the charts where says "Selected Geography" are filtering New York. What I want to do is that the charts on the right should be filtered by US for which I have a filter on the left of "New York". However I would be selecting US on the country filter, the charts on the right should be a world average.

 

Any idea / tip ?? Any help would be really appreciated.

ThanksCapture.PNG

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

Hi @Anonymous ,

 

In order to achieve the goal of selecting states and then filtering out countries, you need to create a separate table about states, and then use DAX to map states to countries.

 

Here is a simple example.

Screenshot 2021-05-05 091831.png

Screenshot 2021-05-05 091842.png1.png

 

Then just write a measure like this.

FilteredValue =
CALCULATE (
    SUM ( 'Main Table'[Value] ),
    FILTER (
        'Main Table',
        [Country]
            = CALCULATE (
                VALUES ( 'Table'[Country] ),
                FILTER ( 'Main Table', [State] IN ALLSELECTED ( 'Table'[State] ) )
            )
    )
)

Screenshot 2021-05-05 092047.pngScreenshot 2021-05-05 092054.png

 

Best Regards,

Stephen Tao

 

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
v-stephen-msft
Community Support
Community Support

Hi @Anonymous ,

 

In order to achieve the goal of selecting states and then filtering out countries, you need to create a separate table about states, and then use DAX to map states to countries.

 

Here is a simple example.

Screenshot 2021-05-05 091831.png

Screenshot 2021-05-05 091842.png1.png

 

Then just write a measure like this.

FilteredValue =
CALCULATE (
    SUM ( 'Main Table'[Value] ),
    FILTER (
        'Main Table',
        [Country]
            = CALCULATE (
                VALUES ( 'Table'[Country] ),
                FILTER ( 'Main Table', [State] IN ALLSELECTED ( 'Table'[State] ) )
            )
    )
)

Screenshot 2021-05-05 092047.pngScreenshot 2021-05-05 092054.png

 

Best Regards,

Stephen Tao

 

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

sayaliredij
Super User
Super User

Hi,

 

You can use Edit Interactions option to control the filtering of the visual

 

You can click on the slicer. In the Format option, you will able to see 

sayaliredij_0-1619811991804.png

 

and then block the visuals using this small option

sayaliredij_1-1619812029528.png

This way your slicer will stop controlling that particular visual

 

Regards,

Sayali

 

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





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

I've that applied already, what I am looking for is different, if you select any state, the other filter should be having the country where that selected state is located

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.