Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

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!!!

  • 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.

2 Replies

  • 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.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi johnt75

     

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

     

    Regards