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.
Anonymous unfortunaltey you cannot change active relationship on selection but in your dax measure you can use userrelationship function to make other function active based on selection.
- Anonymous7 years agoNot applicable
Can I create user relationship like a custom column instead of measure, because If I use to measure data is changing as My selection criteria by remaining slicers' data is not getting filtered .
Any Alternate approach to a situation like this?
- parry2k7 years ago
Super User
Anonymous userrelationship can be only used in measure. I exactly not sure whst you are trying to achieve, if you share sample data and what result you are looking for, it will help to see if there is alternate solution.
- Anonymous7 years agoNot applicable
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
- parry2k7 years ago
Super User
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.?