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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
Community Champion
Community Champion

@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

v-xinruzhu-msft
Community Support
Community Support

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

 

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.