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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
DataSc86
Frequent Visitor

Filter a table by a slicer lookup to another table

I have a table that contains a lookup for clients and the type of client: 

 

ClientType
AmazonEcom
GoogleSearch Engine
WalmartEcom
Best BuyEcom

 

I have a slicer for the client and it filters the whole report correctly, but I wanted to do a comparative analysis based on type on a comparison tab. So all the tabs should sync to "Amazon" when they click that (currently works fine without concern) but trying to build out a single tab and table that when you click on "Amazon" it shows the data for just the "Ecom" types ['Amazon', 'Walmart','Best Buy'] so I can show the market analysis. 

 

I have tried to play with multiple formulas and guides online but not able to do it yet based on any tutorial I have found. 

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

I have solved a similar problem in the attached PBi file.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Kedar_Pande
Super User
Super User

@DataSc86 

Create a measure that filters the data for the selected client's type and retrieves data for all clients within that type:

ComparativeData =
VAR SelectedClientType =
SELECTEDVALUE(ClientLookup[Type])
RETURN
CALCULATE(
[YourMeasure], 
TREATAS(
VALUES(ClientLookup[Client]),
'FactTable'[Client]
),
FILTER(
ALL(ClientLookup),
ClientLookup[Type] = SelectedClientType
)
)

This approach dynamically adjusts to show the comparative analysis based on the selected client's type.

 

💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

Anonymous
Not applicable

Hi @DataSc86 

You can refer to the following solution.

Sample data is the same as you provided.

Create a new table, the table has no relationship with other tables.

 

Type = SUMMARIZE('Table',[Client])

 

vxinruzhumsft_0-1733794875776.png

 

Then create a measure.

 

MEASURE =
VAR a =
    CALCULATETABLE (
        VALUES ( 'Table'[Type] ),
        ALLSELECTED ( 'Table' ),
        'Table'[Client] IN VALUES ( 'Type'[Client] )
    )
VAR b =
    COUNTROWS ( FILTER ( 'Table', [Type] IN a ) )
RETURN
    IF ( ISFILTERED ( 'Type'[Client] ), IF ( b > 0, 1, 0 ), 1 )

 

Then create a table visual and put the measure to the visual filter.

vxinruzhumsft_1-1733795017142.png

 

Then create a slicer and put the client field of the type table to the slicer, then filter.

Output

vxinruzhumsft_2-1733795057795.png

Best Regards!

Yolo Zhu

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

 

I am trying to make this work but I have a lot of tables that tie together and its not just really the single table interaction. I'll keep playing with it and once I validate I can make it work will accept as the solution

 

Anonymous
Not applicable

Hi @DataSc86 

Did the solution i offered before help you solve the problem, if it helps, you can consider to acceppt it as a solution so that more user can refer to, or if you still have other problems you can offer some more infotmation that can provide more suggestion for you.

 

Best Regards!

Yolo Zhu

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.