Forum Discussion

Bmejia's avatar
Bmejia
Icon for Super User rankSuper User
3 years ago
Solved

Dynamic Header with All data and by what is being filter

I am trying to figure out how to create a dynamic header that shows all the values in a particular column base on what is being filter at the page level and what the user is filtering on.   Example...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Bmejia ,

     

    Both Page level filter and drop down slicer are all filters, so if you use same Category column from table in them, it is hard to achieve your goal.

    I suggest you to create an unrelated Category table for slicer.

    Category for User = VALUES('Table'[Category])

    Create a measure to filter this slicer.

    Measure Filter = 
    IF(MAX('Category for User'[Category]) in VALUES('Table'[Category]),1,0)

    Add measure into visual level filter and set it to show items when value = 1.

    New Measure:

    Category Header = 
    VAR _FilterbyPagelevel =
        CONCATENATEX ( VALUES ( 'Table'[Category] ), 'Table'[Category], ", " )
    VAR _FilterbyUser =
        CONCATENATEX (
            VALUES ( 'Category for User'[Category] ),
            'Category for User'[Category],
            ", "
        )
    RETURN
        "All Categories Being Filter at page level" & " " & _FilterbyPagelevel & " "
            & IF (
                ISFILTERED ( 'Category for User'[Category] ),
                "Data, Filter by" & " " & _FilterbyUser
            )

    Result is as below.

     

    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.