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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
nrustamli
Frequent Visitor

Multiple slicers for one visual

Hello there. I am trying to apply two separate sliders for one visual. The data I am working on has the following structure:

CountriesYearVariable 1Variable 2Variable 3
Austria2018755621
Austria201975243
Austria202048793
Austria2021736917
Belgium2018825756
Belgium2019673611
Belgium202034455
Belgium202119052
Denmark2018223456
Denmark2019851548
Denmark202053157
Denmark20215727100
Ireland2018721837
Ireland2019781954
Ireland2020159762
Ireland2021374572
Netherlands2018491680
Netherlands2019999465
Netherlands2020374312
Netherlands2021848513
Sweden201830799
Sweden201954894
Sweden2020557664
Sweden2021999394

 

The main purpose of the dashboard I want to create is to compare two countries/entities. I want to have the following structure:

nrustamli_2-1612261243872.png

 

So the idea is that, Slicer 1 picks the country for Figure 1, Slicer 2 picks the country for Figure 2, but both slicers should pick a country (each) for Figure 0 - so it should have two lines. When I pick one country in each slicer, the Figure 0 turns blank. Would appreciate any help to fix this, but also any ideas that would have a more straightforward way to represent this concept.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @nrustamli ,

 

The file is here, you can check if it is what you want.

Because I don’t know your needs, so the value shown in my picture is Variable 1.

Measure = 
CALCULATE (
    SUM ( 'Table'[Variable 1] ),
    FILTER ( 'Table', [Countries] = SELECTEDVALUE ( Slicer1[Countries] ) )
)
Measure 2=
CALCULATE (
    SUM ( 'Table'[Variable 1] ),
    FILTER ( 'Table', [Countries] = SELECTEDVALUE ( Slicer2[Countries] ) )
)
Measure 3 = IF(ISFILTERED(Slicer2[Countries]),[Measure])
Measure 4 = IF(ISFILTERED(Slicer1[Countries]),[Measure 2])

22.png23.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

7 REPLIES 7
Anonymous
Not applicable

Hi @nrustamli ,

 

The file is here, you can check if it is what you want.

Because I don’t know your needs, so the value shown in my picture is Variable 1.

Measure = 
CALCULATE (
    SUM ( 'Table'[Variable 1] ),
    FILTER ( 'Table', [Countries] = SELECTEDVALUE ( Slicer1[Countries] ) )
)
Measure 2=
CALCULATE (
    SUM ( 'Table'[Variable 1] ),
    FILTER ( 'Table', [Countries] = SELECTEDVALUE ( Slicer2[Countries] ) )
)
Measure 3 = IF(ISFILTERED(Slicer2[Countries]),[Measure])
Measure 4 = IF(ISFILTERED(Slicer1[Countries]),[Measure 2])

22.png23.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.

Hi Stephen, 

 

I have the similar project like nrustamli that I want to apply two slicers(filters) for one visual.  I tried to follow your measures but it ran into an issues.  It keeps telling me that 'Cannot find table 'Slicer1'.  Can you help me on how to fix it? 

 

TIA,

Kieu  

Thanks a lot Stephen, this indeed solves it!

nvprasad
Solution Sage
Solution Sage

Hi,

 

You can use the edit interactions option under the format tab (Select slicer first then go to format tab) to fix this issue.

 

nvprasad_0-1612261764142.png

 

 

Appreciate a Kudos! 🙂
If this helps and resolves the issue, please mark it as a Solution! 🙂

Regards,
N V Durga Prasad

Did I answer your question? Mark my post as a solution! Appreciate your Kudos.
Follow me on LinkedIn.

Hello, could you please elaborate on this? Because my first thought was about the interactions as well, here how the interactions of Slicer 1 look:

nrustamli_0-1612262072465.png

And here are the interactions of Slicer 2:

nrustamli_1-1612262100916.png

Anything else that needs to be done here?

@nrustamli , you need two lines one from slicer 1 and one from slicer 2. In that case you need independent tables(at least one)

refer my date example - You need to slicer for country in place of date

https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
amitchandak
Super User
Super User

@nrustamli , You should be able to do that with edit interaction. Switch interactions between 1 and 2.

https://docs.microsoft.com/en-us/power-bi/create-reports/service-reports-visual-interactions

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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