Forum Discussion
Active relationship based on Slicer
- 7 years ago
Anonymous you need to unpivot table b and then set the relationship between both the table, after that it will work as expected.
To unpivot, select all column table b excep (those four columns) and right click after selection and clicking unpivot other column, it will give you two column attribute and value (change column name as per your need)
Now set relationship between table 2 with table 1 on attribute and selection.
Now if you filter from selection, you table2 will show respective values.
Table 1
Id | Selection |
1 | This month |
1 | This year |
2 | Prev MOnth |
2 | Last Year |
Table 2
State | Country | Id | This month | This Year | Prev Month | Last Year | Customer | DOB |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
I modeled 2 tables as follows:
Table 1 "Selection colum " --> This month
"Selection colum " --> This year (Active relation ship)
"Selection colum " --> Prev month (Non-Active relation ship)
"Selection colum " --> Last year ( non- Active relation ship)
Since a table has only 1 active relation, "Selection column " --> This month is active
now in report, I am using Table 1 "Selection" as a slicer,
and it will display as
This month |
This year |
Prev Month |
Last Year |
If I select "this month" in table 1 it should map to "this month" column in table 2 and data must be filtered
if I select "This year " in table 1 it should map to "This year " column in table 2 and data must be filtered
...
Hope this is clear.
Thanks
Aditya
Anonymous you need to unpivot table b and then set the relationship between both the table, after that it will work as expected.
To unpivot, select all column table b excep (those four columns) and right click after selection and clicking unpivot other column, it will give you two column attribute and value (change column name as per your need)
Now set relationship between table 2 with table 1 on attribute and selection.
Now if you filter from selection, you table2 will show respective values.
- Anonymous7 years agoNot applicable
My data is very huge, Cannot unpivot, is there any other way.?
- parry2k7 years ago
Super User
Anonymous i think yes it can be done with other method, I have to make a solution, hard to explain if you can share sample data in excel thru one drive/google drive, i will try to get back to you. cheers!!