Forum Discussion
Matrix Row Filtering Alters Rolling DATESINPERIOD Measures
- 3 months ago
Hi AC23VM ,
Thanks for your patience while we looked into this further.
We tested a workaround using conditional formatting to suppress the value columns for Journeys with no current-month activity. While this hides the values themselves, the Journey name still remains visible in the row header and the blank row continues to take up space in the matrix. That was the closest behavior we could achieve within a single matrix visual.
So based on our testing, your understanding is correct. In a single matrix visual, it isn't currently possible to fully achieve all three together: keeping historical Journey data for the rolling window, hiding Journeys with no current-month activity, and preserving correct per-Journey rolling values.
One possible approach is to split the requirement across two visuals. For example, you could use one visual for the overall rolling % calculation using ALLSELECTED or REMOVEFILTERS, and a separate matrix filtered to active Journeys only for the row-level breakdown.
In most cases, filtering inactive Journeys at the row level should not affect other Journey rows if each rolling measure is scoped correctly, though that would still depend on the exact DAX logic being used in the model.
From what we could determine, this is current matrix visual behavior in Power BI, since row visibility and filter context are tightly connected by design.
Hope this helps. Please reach out for further assistance.
Thank you.
Thanks for the detailed reply - I appreciate you taking the time to explain the behaviour, and I agree that what’s happening is expected given how matrix visuals apply filter context. Where I’m struggling is that, in this particular scenario, the usual ALL / ALLSELECTED pattern doesn’t seem to get me past the trade‑off.
To clarify my setup a bit more, my rolling calculation already has both the numerator and denominator wrapped in the same DATESINPERIOD window, for example:
- Harms (3M) = CALCULATE( … , DATESINPERIOD(…))
- Volume (3M) = CALCULATE( … , DATESINPERIOD(…))
- Rolling % = DIVIDE( [Harms (3M)], [Volume (3M)] )
With this approach, the 3‑month rolling result is mathematically correct as long as all Journeys remain in the matrix, including those with no current‑month activity.
The difficulty is entirely around row visibility:
- If I keep Journeys with BLANK current‑month volume, the rolling % is correct, but the matrix includes rows that aren’t very meaningful to the user.
- If I remove those rows (via visual filters or measure‑level blanking), the Journey filter context changes, and those Journeys also drop out of the historical 3‑month window - which causes the category‑level rolling % to change.
I did try the suggested approach of removing the Journey row context using ALLSELECTED / REMOVEFILTERS. That does stabilise the rolling calculation, but it introduces a different issue for me: the same category‑level rolling value ends up being repeated on each Journey row, which no longer reflects how each Journey contributes within the rolling period:
So I feel a bit stuck between these competing requirements inside a matrix:
- Preserve Journey history for the rolling window
- Hide Journeys with no current‑month activity
- Avoid repeating a single category‑level value on every Journey row
At the moment, it looks like row visibility and calculation context can’t really be decoupled in a table/matrix visual - hiding rows inevitably feeds back into filter context for the measure.
That’s mainly what I’m trying to sanity‑check: whether anyone has found a reliable workaround for controlling row visibility independently of a rolling DATESINPERIOD calculation, or whether this is simply a known limitation of how table/matrix visuals behave. I suspect it may be the latter, but I wanted to check before redesigning the visual or model.
Hi AC23VM ,
Thanks for your patience while we looked into this further.
We tested a workaround using conditional formatting to suppress the value columns for Journeys with no current-month activity. While this hides the values themselves, the Journey name still remains visible in the row header and the blank row continues to take up space in the matrix. That was the closest behavior we could achieve within a single matrix visual.
So based on our testing, your understanding is correct. In a single matrix visual, it isn't currently possible to fully achieve all three together: keeping historical Journey data for the rolling window, hiding Journeys with no current-month activity, and preserving correct per-Journey rolling values.
One possible approach is to split the requirement across two visuals. For example, you could use one visual for the overall rolling % calculation using ALLSELECTED or REMOVEFILTERS, and a separate matrix filtered to active Journeys only for the row-level breakdown.
In most cases, filtering inactive Journeys at the row level should not affect other Journey rows if each rolling measure is scoped correctly, though that would still depend on the exact DAX logic being used in the model.
From what we could determine, this is current matrix visual behavior in Power BI, since row visibility and filter context are tightly connected by design.
Hope this helps. Please reach out for further assistance.
Thank you.