Skip to main content

Power BI

New

Retrieve state from filters and other visuals

Vote (1) Share
Konstantin Volke's profile image

Konstantin Volke on 22 Mar 2023 07:39:19

Scenario


I have a filter menu that opens through a bookmark for further filtering by clicking on the 3 dots next to the date filter. The filter menu is sometimes neccessary if a report contains several slicers that would otherwise take too much space on the available report area. Its visibility toggled with a button through bookmarks. The button can show a filter symbol or in my case three dots.


However, the custom filter pane is normally hidden (due to generally scarce page for other visual information), there's no way for the user to see that a (invisible) filter is applied from the custom filter pane.


So I wrote a measure to check if any filters are applied to a column from the data-model:

#_ActiveFilters =

  SWITCH(

    TRUE(),

    ISFILTERED('Filter Gebinde'[Gebindetypgruppe]),1,

    ISFILTERED('Filter Gebinde'[Gebindetyp] ) , 1,

    ISFILTERED('Filter Artikelstamm'[Artikelbezeichnung]), 1,

    ISFILTERED('Filter Gebinde Barcode'[Barcode]), 1,

0

  )


Depending on the measure the three dots change color to orange if something is filtered stay white if nothing is filtered. The visual state of the invisible filters is thus visibile.


The problem


However, if I filter an attribute through visuals on the report, it is also filtered but not through the (hidden) filters on the filters pane... The visual information for the end user is misleading again because the color of the filter pane icon would change even though no filters are applied through the slicers (but through other visuals)


The suggestion

Long story show: Is there a way to capture the (filter)-state of the slicers or any other state through e.g. DAX? Something like ISFILTERED([NameOfVisual])? I could use this information to change the color of my filter icon depending on the state of the visual and not depending on the visual interactions by any other data-model-related selections.