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
Ramkiyanala
New Member

Power bi challenge

We have two employee tables which have no relation between them. There is a common column country in two tables
In report I have one visual from first table and another visual from second table.
Now challenge is how can we interact both visuals with one slicer from either of tables? 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Your solution is worked @ryan_mayu , Here are the results of my tests:

Hi, @Ramkiyanala 

I have created a simple example data where there are two tables, both of which have country columns:

Table1:

vjianpengmsft_0-1721786550574.png

Table2:

vjianpengmsft_1-1721786566932.png

I first created a table of calculations using the following DAX expression:

Country Table = 
VAR _table1_country = SUMMARIZE('Table1','Table1'[Country])
VAR _table2_country = SUMMARIZE('Table2','Table2'[Country])
RETURN DISTINCT(
    UNION(_table1_country,_table2_country)
)

Use this calculated table to create a 1-to-many relationship with the COUNTRY column of the other two tables:

vjianpengmsft_2-1721786679524.png

The visual objects that you mentioned as coming from two separate tables are created in the report:

vjianpengmsft_3-1721786751175.png

vjianpengmsft_4-1721786770928.png

Create a slicer using the country column of the calculation table:

vjianpengmsft_5-1721786828875.png

The results are as follows:

vjianpengmsft_6-1721786862412.png

vjianpengmsft_7-1721786883165.png

I have provided the PBIX file used in this instance below.

 

 

Best Regards

Jianpeng Li

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

4 REPLIES 4
Anonymous
Not applicable

Your solution is worked @ryan_mayu , Here are the results of my tests:

Hi, @Ramkiyanala 

I have created a simple example data where there are two tables, both of which have country columns:

Table1:

vjianpengmsft_0-1721786550574.png

Table2:

vjianpengmsft_1-1721786566932.png

I first created a table of calculations using the following DAX expression:

Country Table = 
VAR _table1_country = SUMMARIZE('Table1','Table1'[Country])
VAR _table2_country = SUMMARIZE('Table2','Table2'[Country])
RETURN DISTINCT(
    UNION(_table1_country,_table2_country)
)

Use this calculated table to create a 1-to-many relationship with the COUNTRY column of the other two tables:

vjianpengmsft_2-1721786679524.png

The visual objects that you mentioned as coming from two separate tables are created in the report:

vjianpengmsft_3-1721786751175.png

vjianpengmsft_4-1721786770928.png

Create a slicer using the country column of the calculation table:

vjianpengmsft_5-1721786828875.png

The results are as follows:

vjianpengmsft_6-1721786862412.png

vjianpengmsft_7-1721786883165.png

I have provided the PBIX file used in this instance below.

 

 

Best Regards

Jianpeng Li

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

 

 

 

ryan_mayu
Super User
Super User

could you pls provide some sample data and expected output?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Unfortunately, I have no sample data for this. It was asked in interview. 

I answered as we need to create relationship between those tables as already common column is existing. So, building relation between table helps in solving the challenge. 

 

But I don't know whether I am correct or wrong. 

I think next time you can ask the interviewer what the solution is.

In my opinion, there must be duplicated in country column for each table. If you create the relationship between two tables, that will be a many to many relationship. That is not recommended.

If I meet this scenario, I will create a dim country table and use that table to filter two visuals.

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
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