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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
cturner
Helper I
Helper I

Filter Dimension Two by column in Dimension One

I've been googling this today, and can't quite get clarity on the correct approach:

I have a star schema database with multiple facts and multiple dimensions.  Each fact has foreign keys for each dimension, corresponding to primary keys in the dimension table.  We group data across the various fact tables based only on these dimensions.

 

We've been asked to limit the contents of the slicer for dimension 2 by our selection of the slicer in dimension 1.  We can't add a FK for dimension 1 to dimension 2 to join them as it creates ambiguity and powerbi refuses to join them.

 

for dimension 1, we have id, business_name, and type

for dimension 2, we have columns id, product_name, and type

 

column 1 is whole number

column 2 and 3 are text

only column 1 is unique in both tables.

 

without a relationship between the tables, whats the proper dax pattern for returning only the rows in dimension 2 that share the same value for column type as the rows selected by the slicer for dimension 1?

 

Thanks.

5 REPLIES 5
Eric_Zhang
Microsoft Employee
Microsoft Employee


@cturner wrote:

I've been googling this today, and can't quite get clarity on the correct approach:

I have a star schema database with multiple facts and multiple dimensions.  Each fact has foreign keys for each dimension, corresponding to primary keys in the dimension table.  We group data across the various fact tables based only on these dimensions.

 

We've been asked to limit the contents of the slicer for dimension 2 by our selection of the slicer in dimension 1.  We can't add a FK for dimension 1 to dimension 2 to join them as it creates ambiguity and powerbi refuses to join them.

 

for dimension 1, we have id, business_name, and type

for dimension 2, we have columns id, product_name, and type

 

column 1 is whole number

column 2 and 3 are text

only column 1 is unique in both tables.

 

without a relationship between the tables, whats the proper dax pattern for returning only the rows in dimension 2 that share the same value for column type as the rows selected by the slicer for dimension 1?

 

Thanks.


@cturner

You may need a measure as below. See the attached pbix file.

isExistsInTable1 = IF(MAX(Table2[id]) in VALUES(Table1[id]),1,BLANK())

Capture.PNG

 

Capture.PNG

 

This is helpful, and may contain the seeds of a working approach.  However, I don't want to use ID for the condition.  I want to use type:

 

Table 1

 

id,business name,type

1,bname1,type1

2,bname2,type2

3,bname3,type1

4,bname4,type2

 

Table 2

 

id,productname,type

1,pname1,type1

2,pname2,type2

3,pname3,type1

4,pname4,type2

 

Slicer1 for type in table 1 contains the values type1,type 2.

Slicer2 for productname in table 2 contains the values pname1-pname4.

 

I want the type selected in slicer 1 to determine the contents of slicer 2

 

type 1 ->  pname1,pname3

type 2 -> pname2,pname4

 

Thanks.


@cturner wrote:

 

This is helpful, and may contain the seeds of a working approach.  However, I don't want to use ID for the condition.  I want to use type:

 

Table 1

 

id,business name,type

1,bname1,type1

2,bname2,type2

3,bname3,type1

4,bname4,type2

 

Table 2

 

id,productname,type

1,pname1,type1

2,pname2,type2

3,pname3,type1

4,pname4,type2

 

Slicer1 for type in table 1 contains the values type1,type 2.

Slicer2 for productname in table 2 contains the values pname1-pname4.

 

I want the type selected in slicer 1 to determine the contents of slicer 2

 

type 1 ->  pname1,pname3

type 2 -> pname2,pname4

 

Thanks.


@cturner

Then create a measure in the same way with type column.

isExistsInTable1 = IF(LASTNONBLANK(Table2[type],"") in VALUES(Table1[type]),1,BLANK())

@Eric_Zhang thanks so much, this is very helpful.

 

Is there a similar approach that would work for multiple selections/all in the slicer?


@cturner wrote:

@Eric_Zhang thanks so much, this is very helpful.

 

Is there a similar approach that would work for multiple selections/all in the slicer?


@cturner

The measure shall works for multiple sections in a slicer, have you got any problem?

Capture.PNG

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.

Top Solution Authors
Top Kudoed Authors