Forum Discussion
Using Slicer selected value to change which relationship is active
- Anonymous4 years ago
Hi Anonymous ,
If you want to add the measure into filter, you may try this code to create a measure. I suggest you to change all relationships between two tables to inactive.
BrandSlicer = VAR _tab = VALUES ( BrandNameList[BrandNames] ) RETURN IF ( MAX ( BrandNames[AUDI] ) IN _tab || MAX ( BrandNames[VW] ) IN _tab || MAX ( BrandNames[SBA] ) IN _tab || MAX ( BrandNames[CUPRA] ) IN _tab || MAX ( BrandNames[SKODA] ) IN _tab, 1, 0 )Then add this measure into the visual level filter in your visual and set it to show items when value =1.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Currently my DAX looks like this:
But I am unsure what to put as the Table after SUM(
because if I use it the way I wrote and put the measure as a filter on a visual it does not work.
(I have also removed all the relationships prior to doing this)
Hi Anonymous ,
If you want to add the measure into filter, you may try this code to create a measure. I suggest you to change all relationships between two tables to inactive.
BrandSlicer =
VAR _tab =
VALUES ( BrandNameList[BrandNames] )
RETURN
IF (
MAX ( BrandNames[AUDI] )
IN _tab
|| MAX ( BrandNames[VW] )
IN _tab
|| MAX ( BrandNames[SBA] )
IN _tab
|| MAX ( BrandNames[CUPRA] )
IN _tab
|| MAX ( BrandNames[SKODA] ) IN _tab,
1,
0
)
Then add this measure into the visual level filter in your visual and set it to show items when value =1.
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.