Forum Discussion

Alaska1's avatar
Alaska1
Frequent Visitor
1 year ago
Solved

Slicer in Visuals not working

I created a column that calculates the average score by quarter index and then subtracts the average from the current quarter minus the previous quarter.   All my data is one table. 

 

When I use the calculated column in a matrix to show the difference between each quarter, I cannot get the filter to work.  I want the matrix to filter based on the slicers I have on my page.  I have a slicer for Location, Tenure and Age.  When selecting those slicers, my numbers do not change.  

 

I used the DAX formula below to get the differenct between quarter scores:

 

Difference = VAR CurrentIndex = ‘Response’[QuarterIndex] VAR PreviousValue = Calculate( max(‘Response’[value]), Filter( ‘response’, ‘Response’[quarterindex] = CurrentIndex -1

)

)

Return

if(isblank(previousvalue),Blank(),’response’[value]-previousvalue)

 

  • Calculated columns are calculated once, after the semantic model refresh. They do not react to filter changes. If you need that then use measures.

  • Hi Alaska1 ,

    We’re following up once more regarding your query. If it has been resolved, please mark the helpful reply as the Accepted Solution to assist others facing similar challenges.

    Please reach out if further assistance is needed.
    Thank you.

7 Replies

  • Calculated columns are calculated once, after the semantic model refresh. They do not react to filter changes. If you need that then use measures.

  • v-veshwara-msft's avatar
    v-veshwara-msft
    Community Support

    Hi Alaska1 ,
    Thanks for using Microsoft Fabric Community,
    Thnaks to lbendlin for valuable response.
    As mentioned, Calculated columns are static. They are computed once when the data model refreshes and do not respond to slicers or report filters. So when you filter by Location, Tenure, or Age, the column still shows the original unfiltered values  that’s why your matrix doesn’t update.

    So using a measure is recommended approach beacuse measure are dynamic and obey slicers or filters applied.

     

    Feel free to reach out for further assistance.
    Please mark the helpful reply as "Accepted solution" to assist others find the solution quickly.
    Thank you.

     

  • Hi Alaska1

     

    Based on what you've described, it looks like the slicer isn't reacting as expected because the measure relies on a calculated column.

     

    In Power BI, slicers typically interact more dynamically with measures rather than calculated columns. Calculated columns are computed during model processing, so any filter applied afterward (via slicers) won’t affect them unless explicitly handled in the DAX.

     

    To resolve this, try refactoring your logic into a measure using something like this:

    AvgDiff =
    AVERAGEX (
        VALUES ( 'Date'[Quarter] ),
        CALCULATE (
            AVERAGE ( 'Table'[Value] ) - 
            CALCULATE ( AVERAGE ( 'Table'[Value] ), PREVIOUSQUARTER ( 'Date'[Date] ) )
        )
    )
    

     

    Make sure your date table is properly marked as a date table, and relationships are correctly set up between your data and slicer fields. This way, slicers will interact with visuals and measures as expected.

  • v-veshwara-msft's avatar
    v-veshwara-msft
    Community Support

    Hi Alaska1 ,

    Following up to see if your query has been resolved. If so, please consider marking the helpful response as the Accepted Solution to assist others with similar issues. If you still need assistance, feel free to reach out.

    Thank you.

  • v-veshwara-msft's avatar
    v-veshwara-msft
    Community Support

    Hi Alaska1 ,

    Just checking in again as we haven’t heard back from you. If the provided solutions addressed your issue, kindly mark the helpful reply as the Accepted Solution to assist others with similar queries.

    If your issue is still unresolved or you need further help, feel free to reach out.
    Thank you.

  • v-veshwara-msft's avatar
    v-veshwara-msft
    Community Support

    Hi Alaska1 ,

    We’re following up once more regarding your query. If it has been resolved, please mark the helpful reply as the Accepted Solution to assist others facing similar challenges.

    Please reach out if further assistance is needed.
    Thank you.