Forum Discussion

Ramkiyanala's avatar
Ramkiyanala
New Member
2 years ago
Solved

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. No...
  • Anonymous's avatar
    Anonymous
    2 years ago

    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:

    Table2:

    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:

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

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

    The results are as follows:

    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.