Forum Discussion
How to have 2 active relationships between 2 tables
Both ColumnA and ColumneB are string. And there can be multipe row with same value in Table1 and Table2.
So Table 1 and Table 2 shoul dhave a Many - To -Many relationships with ColumnA and ColumnB.
Althought there can be multiple row with same values in ColumnA and Column B, But the combination of ColumnA and ColumnB values is unique in Table 1 and Table 2.
OK, then a creating a common key/index/ID for each unique A,B pair in the query editor is a decent solution.
Here's an example of how this works:
http://radacad.com/relationship-in-power-bi-with-multiple-columns
- sacheu7 years ago
Microsoft Employee
Thanks. I read that post http://radacad.com/relationship-in-power-bi-with-multiple-columns.
But I don't understand how to apply to my problem. :o
I have visual (piechart and a stackcolumn chart) for my Table 1, and Table 2 's visual is a table.
piechart is summarized based on ColumnA of Table 1.
stackcolumn is summarized based on Column B of Table 1.
Even if i create a calucated column in each of my Table 1 and Table 2, i
how can I make powerBI display Table2 values according to what i selected in Table 1 visual?
e.g.
e.g. if i select a particular value of Column A in the pie chart,
Table2 only shows the rows with ColumnA equals to what is selected
same as if i select a value in Column B in the stacked column chart,
Table 2 only shows the rows with the selected column B.
- AlexisOlson7 years ago
Super User
If you have the index I suggested, then you can set the relationship to filter both directions, which should do exactly what you want.
- sacheu7 years ago
Microsoft Employee
Thanks for your solution. Having 1 index column let me to get to this state:
1. click visual for Column A of Table1, visual for Table 2 will be filted to show its Column A of what is selected
2 click visual for Column B of Table1, visual for Table 2 will be filted to show its Column B of what is selected
But how can I filter Table 2 of what is selected of Column A *AND* Column B of Table 1?