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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

slicer to influence two DAX generated tables

I have two DAX generated tables with similar a similar column name:

 

Table1

Name     Age

Alpha     5

Beta       14

Gamma  22

 

Table2

Name     Age    other columns

Alpha     5          xx

Beta       14        xx

Gamma  22        xx

Alpha     12          xx

Beta       14        xx

Gamma  27        xx

 

I have a slicer called Name based on Table1. I want this slicer to also influence Table2.

 

I tried https://blogs.technet.microsoft.com/cansql/2016/12/19/relationships-in-power-bi-fixing-one-of-the-co... but this works in power query only. My DAX generated tables are not present in power query.

 

Is there a way to link them so this works?

1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

in DAX you can do it like this

Name Slicer = DISTINCT(UNION(VALUES('Table1'[Name]),VALUES('Table2'[Name])))

and then create a join to your data tables



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

3 REPLIES 3
Stachu
Community Champion
Community Champion

you need to either join the tables or create a virtual join with DAX
the simplest solution is to create a 3rd table that will only have unique names and join it with the 2 data tables with slicer on a new table
more complex options is using TREATAS to create virtual reltionship
https://www.sqlbi.com/articles/propagate-filters-using-treatas-in-dax/



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Anonymous
Not applicable

Thanks for the suggestions @Stachu

 

can you suggest how best to make and link the third table? I am still relatively new to pbi

Stachu
Community Champion
Community Champion

in DAX you can do it like this

Name Slicer = DISTINCT(UNION(VALUES('Table1'[Name]),VALUES('Table2'[Name])))

and then create a join to your data tables



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.