Forum Discussion
Quiny_Harl
Advocate III
4 years agoDisplay visual only when no more than 2 values are selected from a page filter/slicer
Hi All, I have a table visual which I want to be displayed only when no more than 2 items are selected from a specific slicers/filters. This is for performance reasons since the table visual contai...
Greg_Deckler
Community Champion
4 years agoQuiny_Harl Referencing a table is a table expression because it returns a table. To get the intellisense prompts you need to use the single quote character ' so:
Is Filter Selected =
VAR Count_Items = COUNTROWS(DISTINCT(SELECTCOLUMNS('Table',"Item",[Item])))
VAR Count_Country = COUNTROWS(DISTINCT(SELECTCOLUMNS('Table',"Country",[Country])))
VAR Count_Month = COUNTROWS(DISTINCT(SELECTCOLUMNS('Date',"Month",[Month])))
VAR Count_Year = COUNTROWS(DISTINCT(SELECTCOLUMNS('Date',"Year",[Year])))
RETURN
IF( Count_Items <= 2 || Count_Country = 1 || AND(Count_Year=1,Count_Month=1),
1,0 )Quiny_Harl
Advocate III
4 years agoUnfortunatelly, it didn't help. The thing is that both my and your measure return correct results. Meaning they return 1 when the specified filters are applied and they return zero when they are not applied. So they work.
However, when I put them as a filter for my visual and set the filter to "show items when the value is 1", it continues to show my table visual even when the measure equals 0. Which makes no sense at all.