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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Relationship Between two tables

Hi team,

 

I have two tables. Table A contains the count of registrations country wise and Table B contains Total number of usres. I have divide the sum of registrations with the sum of to total registrations to get it country wise. However it is not filtering the country properly as I have takem the country coulmn from Table A. Below is the result what it is giving.
In table A there are 20 rows for India with count 2 in each row so when I will sum that it will give me 40 and in Table B I have 50 rows for India with count 2 on each row so summing that up will come to 100. So the result I want is 40/100, however it is dividing with the sum of all the countries in Table B. When I an trying to create a relationship between thios two tables it is giving en error.

Can someone please help!!!

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Create a new table with all the countries in, like

Countries = DISTINCT( UNION(
ALLNOBLANKROW('Table 1'[Country]),
ALLNOBLANKROW('Table 2'[Country])
))

then create one-to-many relationship from the new table to both existing tables. Use the column from the new table in your visuals.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi johnt75

 

Thanks a lot. That helped me solved my problem Thank you.

 

Regards

johnt75
Super User
Super User

Create a new table with all the countries in, like

Countries = DISTINCT( UNION(
ALLNOBLANKROW('Table 1'[Country]),
ALLNOBLANKROW('Table 2'[Country])
))

then create one-to-many relationship from the new table to both existing tables. Use the column from the new table in your visuals.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.