Forum Discussion

wcarter's avatar
wcarter
Icon for Advocate III rankAdvocate III
10 hours ago

Odd error on Matrix with Visual Calculation

I'm trying to relieve some of the heavy lifting in a matrix by using a visual calculation instead of a measure for one of the values, but when I try to filter on any of the Values fields in the matrix I get this error:

I can filter rows and columns fine, but whenever any value field is filtered it results in this error, even if that field is not used in the visual calculation. The same thing happens if I try to use a measure to filter the matrix. Any thoughts on what I can do to fix this would be appreciated! (note: I am not trying to filter by the visual calculation, I know that is not supported, this is in relation to filtering any other value field added to the visual)

2 Replies

  • Hi wcarter​ ,

    This isn't a bug — it's a hard limitation of Visual Calculations. They live only inside the rendering context of the visual, not in the model. Because of that, the engine can't resolve filter context when you try to filter on any Values field in a matrix that contains a Visual Calculation.

    The official docs are pretty clear on this: filtering, sorting, and changing aggregations are all listed as unsupported features for visual calculations . It's not just that you can't filter by the Visual Calculation — the presence of one in the visual breaks filtering on other Values fields too.

    What I'd suggest:

    1. Rewrite the calculation as a regular measure, if possible. Measures participate in filter context properly and won't block your Values filters. The only reason to use a Visual Calculation is if you need functions like LOOKUPWITHTOTALS, EXPAND, or ISATLEVEL that only exist in that context.
    2. Filter through Rows or Columns instead, since you've already confirmed that works. If the filter is on a field that can be placed on an axis, that's your path.
    3. Apply the filter outside the visual — via a slicer or page-level filter — rather than through the visual's own Filters pane.

    If the calculation absolutely must stay as a Visual Calculation and you need Values filtering, you're stuck unless Microsoft changes the behavior. There's no workaround that preserves both.

    • wcarter's avatar
      wcarter
      Icon for Advocate III rankAdvocate III

      The AI Slop you copy and pasted is wrong, the documentation doesn't say anything about values in a matrix filtering with Visual Calculations present. 

       

      Most importantly, a much simpler matrix visual with only a single source table, with one row field, one value field, and one visual calculation in the matrix values *does* behave correctly when non-vc values are filtered:

       There's clearly something weird going on with the more complex matrix I've built which has multiple source tables.