Search code examples
powerbidax

Filtering values on one visual affects filtering on second visual


I have a visual in Power BI where I display only certain values. I would like to add a second visual, but in such way that those values showed at the first visual are excluded on the second one and vice versa. So every time when filtering value(even only one), which has been already filtered on previous visual should show empty matrix table. Here I have tried filtering on column Acc Unit with advise of AI but, does not work for me :

SelectedValues = CONCATENATEX(VALUES('YourTable'[YourColumn]), 'YourTable'[YourColumn], ", ")

then

FilterMeasure = IF(CONTAINSSTRING([SelectedValues], 'YourTable'[YourColumn]), 0, 1)

enter image description here

Please advise if You will be so kind.

@added scrrenshot for 6 individual visuals

enter image description here

BR,


Solution

    1. Filters on Visuals are only applied and accessible in that visual, other visuals (and calculations within) are not affected.
    2. When a column is filtered or sliced, it isn't possible to show the other rows of the same table (the values that have been filtered out).

    With the two points above, you will need to do the following.

    Create a table for 'YourTable'[Accounting Unit] which will be used for slicer or filter. This can be a single column table of the distinct values. You can create this in Power Query or DAX. In DAX as a Calculated Table you can use:

    Filter Accounting Unit = DISTINCT(YourTable[Accounting Unit])
    

    Next create a Measure similar to:

    FilterByUnit = 
      IF(
        MAX(YourTable[Accounting Unit]) in DISTINCT('Dim Accounting Unit'[Accounting Unit]),
        1,
        0
      )
    

    Add this measure to each of your tables as a Visual Filter, set one to is 1 to show the filtered values, and the other to is 0 to exclude the filtered values.

    Finally, to tackle point 1 above, add 'Filter Accounting Unit'[Accounting Unit] as either a Page/Report Filter (not a Visual Filter), or add it as a Slicer on your page.

    Note: The above works without needing a relationship defined between Dim Accounting Unit and YourTable.