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
Anonymous
Not applicable

filter based on similar items in dimensional table

Dear all,


For simplicity, I have a dimension table (table1) with a key and two dimensions. Also have a fact table (table2) with the same key and linked one-to-many to teh fact table.  Also have a slicer with the key (ID) of the dimension table as values. When I select a value, I would like to filter the fact table for all ID's that have the same dimensions as the selected value in the slicer, so in my case below id =1,3,4. Anyone any clues?

regards

Table1
IDDim1Dim2
1AC
2AD
3AC
4AC
5BD
6BD
7BC
8BD
Table2
IDCity
1New York
3San Francisco
2Boston
2Atlanta
4Miami
1Seatle
5Houston
7Washington
Outcome
IDCity
1New York
3San Francisco
4Miami
1Seatle



1 ACCEPTED SOLUTION
v-tangjie-msft
Community Support
Community Support

Hi @Anonymous ,

 

According to your description, here are my steps you can follow as a solution.

(1)  My test data is the same as yours.

(2) We can create a table and a measure.

 

Table 3 = 'Table1'
Measure = 
VAR _dim1 = SELECTEDVALUE('Table 3'[Dim1])
VAR _dim2 = SELECTEDVALUE('Table 3'[Dim2])
VAR _table = CALCULATETABLE(VALUES('Table1'[ID]),FILTER(ALLSELECTED('Table1'),'Table1'[Dim1]=_dim1 && 'Table1'[Dim2] =_dim2))
VAR _filter = IF(SELECTEDVALUE('Table2'[ID]) IN _table,1)
RETURN
_filter

 

vtangjiemsft_0-1677028813201.png

(3) Filter visuals with measure and then the result is as follows.

vtangjiemsft_1-1677028918951.png

Best Regards,

Neeko Tang

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

3 REPLIES 3
v-tangjie-msft
Community Support
Community Support

Hi @Anonymous ,

 

According to your description, here are my steps you can follow as a solution.

(1)  My test data is the same as yours.

(2) We can create a table and a measure.

 

Table 3 = 'Table1'
Measure = 
VAR _dim1 = SELECTEDVALUE('Table 3'[Dim1])
VAR _dim2 = SELECTEDVALUE('Table 3'[Dim2])
VAR _table = CALCULATETABLE(VALUES('Table1'[ID]),FILTER(ALLSELECTED('Table1'),'Table1'[Dim1]=_dim1 && 'Table1'[Dim2] =_dim2))
VAR _filter = IF(SELECTEDVALUE('Table2'[ID]) IN _table,1)
RETURN
_filter

 

vtangjiemsft_0-1677028813201.png

(3) Filter visuals with measure and then the result is as follows.

vtangjiemsft_1-1677028918951.png

Best Regards,

Neeko Tang

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

onurbmiguel_
Super User
Super User

Hello 

I have try like this: 

onurbmiguel__0-1675938789599.png

 

create a slicer: 

onurbmiguel__1-1675938837550.png

onurbmiguel__2-1675938863926.png

 

ands i return this output:

onurbmiguel__3-1675938931132.png

 

Is this what you want? 

 

Best regards

Bruno Costa | Solution Supplier

 

Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!! 👍

Take a look at the blog: PBI Portugal 

wp-1586527108426

 

 


Best regards


Bruno Costa | Super User


 


Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!! 


Take a look at the blog: PBI Portugal 


 


Anonymous
Not applicable

not exactly as i just want to slicer on ID =1 and then filter on al similar id's with same characteristics in table1. For small example likt this your sollution would work, but this is a simplification of a much larger case with thousands of row

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

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.