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
E5254730
Frequent Visitor

Slicer - 2 slicer from 2 different tables

Hello,

 

I've 2 tables connected to Power BI dashboard. Both the tables do not have same no. of columns.

Whereas in both tables - there is a common column i.e. Customer Name. Which will be used as Slicer

So I have added 2 slicers (Customer Name column) to my report. One from Table1 (Slicer 1) and one from Table2  (Slicer 2).

A Date table is added to the report and hence we have a relationship with both the tables on Date column.

 

Now - if nothing is selected from both Customer Name Slicer, we have the correct values in Clustered column chart coming from Annual Spend column

But if we make some selection in Slicer 1, we can also see few of the values of Slicer 2 in the chart.

 

How this can be achieved - If no selection in the both Slicers (display values of both)

If selection is made from Slicer 1 - display values of only Table 1 (sum column)

If selection is made from SLicer 2 - display values of only Table 2 (sum column)

 

Please advise. Thanking you in advance!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@E5254730 . Create two measure like

 

filter cust 1 = calculate(isfiltered(Table1[Customer]), allselected())

 

filter cust 2 = calculate(isfiltered(Table2[Customer]), allselected())

 

Now based on above you can switch measure or make measure blank

 

if([filter cust 1], [Measure from Table 1], Blank())

 

 

measure 2=

if([filter cust 2], [Measure from Table 2], Blank())

View solution in original post

2 REPLIES 2
E5254730
Frequent Visitor

@amitchandak ,

 

I used your method and was able to achieve what I was looking for.

 

Thnak you for your time and providing appropriate resolution.

amitchandak
Super User
Super User

@E5254730 . Create two measure like

 

filter cust 1 = calculate(isfiltered(Table1[Customer]), allselected())

 

filter cust 2 = calculate(isfiltered(Table2[Customer]), allselected())

 

Now based on above you can switch measure or make measure blank

 

if([filter cust 1], [Measure from Table 1], Blank())

 

 

measure 2=

if([filter cust 2], [Measure from Table 2], Blank())

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.