Forum Discussion
Show same Top N categories for different visualisations
Hi meg222 ,
If you turn off the interaction, it will be difficult for us to to use the filter in visual 1 in our calculation. Here I suggest you to inactive the relationship between "Demographics" table and "A4" table.
% A4 for Visual1 =
VAR _DIVIDE =
DIVIDE (
CALCULATE (
DISTINCTCOUNT ( A4[UNIQUE_ID] ),
A4[Response] = "Yes",
USERELATIONSHIP ( A4[A4], Demographics[Category] )
),
CALCULATE (
DISTINCTCOUNT ( A4[UNIQUE_ID] ),
USERELATIONSHIP ( A4[A4], Demographics[Category] )
)
)
RETURN
_DIVIDE% A4 for Visual2 =
VAR _LIST =
VALUES ( Demographics[Category] )
RETURN
IF (
MAX ( A4[A4] ) IN _LIST,
DIVIDE (
CALCULATE ( DISTINCTCOUNT ( A4[UNIQUE_ID] ), A4[Response] = "Yes" ),
DISTINCTCOUNT ( A4[UNIQUE_ID] )
)
)
Do not inactive the interaction from slicer in viusal2, and use top3 [% A4 for Visual1] to filter both visuals.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- meg2223 years agoFrequent Visitor
Hi Rico Zhou,
Thank you for taking a look! I'm having some trouble with making the relationship between the demographics table and A4 inactive - it then isn't filtering the first visual for the selected category.
Also my demographics table is a bit different - it doesn't contain the same categories as are in A4 - it has other categories which need to be able to filter both visual 1 and visual 2. I need something which looks like the below with a slicer for Podcast and a slicer for Gender (which are in the demograhics table)
I've attached a sample pbix file here:
Thanks,
Meg