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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
trevordunham
Helper III
Helper III

Using multiple shared columns as filters for two tables at once

I have 3 shared columns between two data tables. I need to keep the data tables separate as they are different data as well as separate API connections. 

 

For discussion, we will call the tables: Table 1 and Table 2, and the shared columns, SharedColumn1, SharedColumn2 and SharedColumn3.

 

I was able to create a table to use SharedColumn1 as a filter for Table 1 and Table 2 like so:

SharedTable1=
DISTINCT(UNION(
  DISTINCT('Table1'[SharedColumn1]),  DISTINCT('Table2'[SharedColumn1])))
 
This returns a column I renamed SharedTableColumn1

I then created relationships between SharedTable1, Table1 and Table2 with the corresponding shared column. I was able to filter my two tables using SharedTableColumn1.
 
I then tried to do the same thing with SharedColumn2 as so:
 
SharedTable2=
DISTINCT(UNION(
  DISTINCT('Table1'[SharedColumn2]),  DISTINCT('Table2'[SharedColumn2])))
 
However when I tried to create relationships between the resulting column SharedTableColumn2 from SharedTable2 and Table1/Table2, I get an error due to ambiguity between Table 1 and Table 2.
 
Anyone know how to fix this or if there is a better method?
 
Thanks
2 REPLIES 2
v-xuxinyi-msft
Community Support
Community Support

Hi @trevordunham 

 

If I understand correctly, you want to create two relationships between two tables. In general, there can only be one active relationship between two tables. If there are multiple relationships, they need to be set to inactive. In addition, specific Cross-filter instructions may lead to errors.

 

The following documents are available for your reference:

https://learn.microsoft.com/en-us/power-bi/transform-model/desktop-create-and-manage-relationships#a... 

https://learn.microsoft.com/en-us/power-bi/transform-model/desktop-create-and-manage-relationships#w... 

 

You can use the following function to specify the relationship to be used in a particular calculation.

USERELATIONSHIP function (DAX) - DAX | Microsoft Learn

 

Best Regards,
Yulia Xu

 

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

Thanks @v-xuxinyi-msft ,

 

I don't necessarily want to use multiple relationships, this was just the method I attempted for my problem. I ultimately just want to be able to filter my two separate tables by 3 shared columns between them.

 

The end result will be a page with two matrix visuals (one for each table) and 3 slicers at the top (the shared columns) that filter both matrix visuals at the same time.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.