Forum Discussion

Pfoster's avatar
Pfoster
Resolver I
1 year ago
Solved

Filter in Selectcolumns not working

Hello all, I am struggeling with an issue in my modell:  I would like to create a table within my modell which takes a specific filter into account.  For my table, I am using this code: KundenAr...
  • DataNinja777's avatar
    1 year ago

    Hi Pfoster,

     

    The issue arises because calculated tables like the one you're using with SELECTCOLUMNS and FILTER are evaluated at data refresh time, not at report interaction time. This means the value from the slicer (SalesGrenze[SalesGrenze Wert]) isn't applied dynamically when users interact with the report. Although SELECTEDVALUE works fine inside a measure and can reflect the slicer selection, calculated tables are static and cannot respond to changes in filter context after they're created. That's why your scatter plot still shows the small dots that should have been filtered out based on the SalesGrenze slicer.

    To resolve this, you should switch to using a measure that filters the data within the visual itself. You can create a measure like this:

    ShowInChart = 
    IF (
        [Sales in KG] > SELECTEDVALUE('SalesGrenze'[SalesGrenze]),
        1,
        0
    )
    

    Then apply this measure as a visual-level filter on your scatter plot, setting it to only show values where ShowInChart = 1. This allows the slicer to affect the chart properly, because measures are evaluated dynamically based on the current filter context. The calculated table approach won’t work in this case if you're expecting interactive filtering.

     

    Best regards,