Forum Discussion
Slicer & Categories Query
- 3 years ago
Hi lherbert501 ,
According to your description, here's my solution.
1.Don't make relationship between the two tables.
2.Create a measure:
Measure = IF ( ISFILTERED ( Category[Category] ), IF ( COUNTROWS ( FILTER ( DISTINCT ( Category[Category] ), 'Category'[Category] IN SELECTCOLUMNS ( FILTER ( ALL ( 'Table' ), 'Table'[Item] = MAX ( 'Table'[Item] ) ), "category", 'Table'[Category] ) ) ) >= COUNTROWS ( DISTINCT ( 'Category'[Category] ) ), 1, 0 ), 1 )Put the measure in the visual level filter and select "is 1", get the correct result:
I attach my sample below for your reference.
Best regards,
Community Support Team_yanjiang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi lherbert501 ,
According to your description, here's my solution.
1.Don't make relationship between the two tables.
2.Create a measure:
Measure =
IF (
ISFILTERED ( Category[Category] ),
IF (
COUNTROWS (
FILTER (
DISTINCT ( Category[Category] ),
'Category'[Category]
IN SELECTCOLUMNS (
FILTER ( ALL ( 'Table' ), 'Table'[Item] = MAX ( 'Table'[Item] ) ),
"category", 'Table'[Category]
)
)
)
>= COUNTROWS ( DISTINCT ( 'Category'[Category] ) ),
1,
0
),
1
)
Put the measure in the visual level filter and select "is 1", get the correct result:
I attach my sample below for your reference.
Best regards,
Community Support Team_yanjiang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is great - Thankyou v-yanjiang-msft for your time with it.
Seems uneccesary code instead of having an OR or AND switch on a slicer though!
Thanks again