si Hwang
si Hwang

Reputation: 307

How to create 2 active relationship between 2 tables

I have 2 tables and 2 of the column have the same values (Time , Value) Table 1

Time y Value
8:00 am 1 2
9:00 am 3 3
10:00 am 5 4
11:00 am 7 1

Table 2

Time Name Value
8:00 am ABC 1
9:00 am DEF 3
10:00 am GHI 2
11:00 am ERQ 4

In a powerBi, I create 1 line charts with Table 1, x-axis is Time, y-axis is y-value and legend is 'value'. And I have a table widget for my 'Table 2'.

So I have a relationship between Table1 and Table 2 so that when I click a time in the chart, the table will filter to the value of the clicked time.

How can I add a 2nd active relationship so that when I click 1 of the value in the line chart (the legend), the Table widget 's data will be filtered to the clicked legend too?

Thank you.

Upvotes: 0

Views: 315

Answers (2)

David Browne - Microsoft
David Browne - Microsoft

Reputation: 88996

Typically in Power BI you introduce "dimension" tables to apply filters to, and then use relationships to flow the filters to the desired tables. EG:

enter image description here

Upvotes: 1

Peter
Peter

Reputation: 12305

That's not how tables work:

If you select one element of a column, e.g. Time = 8:00, the whole row is selected: y = 1 and Value = 2. You can't select the first row of column Time and the third row of column Value simultaneously. This is why it makes no difference if you click on a data point or a legend item.

If you want to see both the outcome of filtering Table 2 by Time and filtering Table 2 by Value you have to create another reference to Table 2

Table 3 = 'Table 2'

and set the relation between the Value columns:

enter image description here

Upvotes: 0

Related Questions