Forum Discussion
Segmentation can filter another segmentation
- 3 years ago
Hi Arthurfrc ,
Please try:
First create tree tables for slicers:
Then apply measure [Flag for segmentation2] to segmentation2, [Flag for segmentation3] to segmentation3:
Flag for segmentation2 = VAR _a = SELECTCOLUMNS ( 'Table', "1", [segmentation] ) RETURN IF ( ISFILTERED ( 'Table'[segmentation] ) && MAX ( 'Table 2'[segmentation] ) IN _a, 0, 1 ) Flag for segmentation3 = VAR _a = SELECTCOLUMNS ( 'Table', "1", [segmentation] ) VAR _b = SELECTCOLUMNS ( 'Table 2', "2", [segmentation] ) RETURN SWITCH ( TRUE (), ISFILTERED ( 'Table'[segmentation] ) && ISFILTERED ( 'Table 2'[segmentation] ) && MAX ( 'Table 3'[segmentation] ) IN UNION ( _a, _b ), 0, ISFILTERED ( 'Table'[segmentation] ) && NOT ( ISFILTERED ( 'Table 2'[segmentation] ) ) && MAX ( 'Table 3'[segmentation] ) IN _a, 0, NOT ( ISFILTERED ( 'Table'[segmentation] ) ) && ISFILTERED ( 'Table 2'[segmentation] ) && MAX ( 'Table 3'[segmentation] ) IN _b, 0, 1 )Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Arthurfrc ,
Please try:
First create tree tables for slicers:
Then apply measure [Flag for segmentation2] to segmentation2, [Flag for segmentation3] to segmentation3:
Flag for segmentation2 =
VAR _a =
SELECTCOLUMNS ( 'Table', "1", [segmentation] )
RETURN
IF (
ISFILTERED ( 'Table'[segmentation] )
&& MAX ( 'Table 2'[segmentation] ) IN _a,
0,
1
)
Flag for segmentation3 =
VAR _a =
SELECTCOLUMNS ( 'Table', "1", [segmentation] )
VAR _b =
SELECTCOLUMNS ( 'Table 2', "2", [segmentation] )
RETURN
SWITCH (
TRUE (),
ISFILTERED ( 'Table'[segmentation] ) && ISFILTERED ( 'Table 2'[segmentation] )
&& MAX ( 'Table 3'[segmentation] ) IN UNION ( _a, _b ), 0,
ISFILTERED ( 'Table'[segmentation] )
&& NOT ( ISFILTERED ( 'Table 2'[segmentation] ) )
&& MAX ( 'Table 3'[segmentation] ) IN _a, 0,
NOT ( ISFILTERED ( 'Table'[segmentation] ) )
&& ISFILTERED ( 'Table 2'[segmentation] )
&& MAX ( 'Table 3'[segmentation] ) IN _b, 0,
1
)
Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Great, thanks, it is what I was searching to my BI.
Just for curiosity... does this work with just one table or do I really need to copy the table to as many different options as I need??