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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Dynamic multiple slicers

Hi everyone!

 

I'm stuck with the following matter: 

 

In my model I have 3 tables:

 

MODEL:

 

SALES:

PRODUCT_ID  VENDOR_ID  QUANTITY(€)  DATE
123AAAAA207/13/2020
221BBBBB5

07/13/2020

 

PRODUCTS:

PRODUCT_ID  CATEGORY  SUBCATEGORY  
123SPORTSFOOTBALL
221SLEEPSHOES

 

 

VENDOR: 

VENDOR_ID  SHOP_TYPE  LOCATION  
AAAAABIGITALY
BBBBBSUPERMARKETGERMANY

 

These tables (vendor and products) are connected by ID to sales table. 

 

 

WHAT I WANT TO DO?

I would like to have in the report, two slicers.

1) To select the "vision" that you want: Product or vendor. (Select slicer in the picture)

2) Select details, i.e: Product selected, and  the category of the product. (PRODUCT slicer in the picture)
Example: 


Capture.PNG

 

 

 

 

 

 

 

 

 

If I change to vendor, it should change insted of showing products (sleep and sports) I should be able to select "SHOP_TYPE"

Many thanks for your help! 🙂

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Create a table with both tables you need:

 

Type        Value

Product Sports
Product Sleep
Vendor AAAAA
Vendor BBBBB

 

Now do the following measure:

Sum Sales =
VAR SelectedType =
    SELECTEDVALUES ( Slicer[Type] )
VAR Selected_Value =
    VALUES ( Slicer[Value] )
RETURN
    SWITCH (
        SelectedType ;
        "Vendor"; CALCULATE ( SUM ( Sales[QUANTITY(€)  ] ); Vendors[VENDOR_ID  ] IN Selected_Value);
        CALCULATE ( SUM ( Sales[QUANTITY(€)  ] ); Products[CATEGORY  ] IN Selected_Value)
    )

 

Now use the measure as your values on the charts as you can see in attach file altough I am selecting on products and vendor one of the visualizations is made on subcategory.

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português





View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@Anonymous , refer Dynamically change chart axis in Power BI
https://www.youtube.com/watch?v=6jeSIRpjv0M

 

Measure slicer

https://community.powerbi.com/t5/Desktop/Slicer-MTD-QTD-YTD-to-filter-dates-using-the-slicer/td-p/50...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Greg_Deckler
Community Champion
Community Champion

@Anonymous - See if this helps: https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-EVERYTHING-measures-axis-legend-titl...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thanks for your answer, the link is great, but it's only working with one table and applying filters to it. In my case, I have multiple tables, and PowerBI should show info from one table or other.

@Anonymous - One thought on this, use buttons instead of slicers for your "vision". Then you could leverage stacked visuals and bookmarks.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi @Anonymous ,

 

Create a table with both tables you need:

 

Type        Value

Product Sports
Product Sleep
Vendor AAAAA
Vendor BBBBB

 

Now do the following measure:

Sum Sales =
VAR SelectedType =
    SELECTEDVALUES ( Slicer[Type] )
VAR Selected_Value =
    VALUES ( Slicer[Value] )
RETURN
    SWITCH (
        SelectedType ;
        "Vendor"; CALCULATE ( SUM ( Sales[QUANTITY(€)  ] ); Vendors[VENDOR_ID  ] IN Selected_Value);
        CALCULATE ( SUM ( Sales[QUANTITY(€)  ] ); Products[CATEGORY  ] IN Selected_Value)
    )

 

Now use the measure as your values on the charts as you can see in attach file altough I am selecting on products and vendor one of the visualizations is made on subcategory.

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português





Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors