USERELATIONSHIP not working as expected. Could use some suggestions.
Im working on a report that invovles interactive mapping. The complexity with the project is that there are different legends for different data layers which means I have to use a table to get a working legend.
I have two key tables: Legend_Table and Pollution_Data.
I have a slicer that switches the map data (which is using Pollution_Data) between NO2 and NOX.
Within these tables I need the following relationships established for filtering:
Legend_Table[Cat] <-> Pollution_Data[NO2_Cat]
Legend_Table[Cat] <-> Pollution_Data[NOX_Cat]
Legend_Table[Cat] contains all the values that would match with either the NO2_Cat or NOX_Cat collumns.
Obviously, connecting these relationships and trying to make them both active does not work. So I have been attempting to use "USERELATIONSHIP" to switch between the relationships depending on the data selected.
As a test run I did one active relationship like this for "Legend_Table[Cat] <-> Pollution_Data[NO2_Cat]":
Which means that the table is filtered down to just the NO2 catageories and Hex codes:
And also allows me to click an item in the table to filter down the map to just those categories (the map is using Pollution_Data):
However, I have a switch that lets users change between NO2 and NOX but I want to maintain the legend interactivity. To do this I create two inactive relationships for NO2 and NOX as so (note the screenshot is incorrect but both relationships are both ways):
Now this works for filtering the table (or legend, as its intended as in this case) so that NO2 and NOX selections result in different values:
However, when clicking a category in the legend table like before, the map no longer filters:
I thought that USERELATIONSHIP would make the relationships function in exactly the same way but just switch according to what was selected in the slicer. What am I missing here? Are there any other methods that can be used to achieve a similar outcome?