Additional SQL Server features and topics not covered by specific categories
As far as I can tell, this is an expected Power BI filter context behavior: your slicer on Name (or AssignedTo) is coming from the same table as ModifiedBy, so when you select John Smith, Power BI applies a row-level filter to WidgetHistory. By the time your measure runs, the rows modified by Jane Doe are already gone, and ALL(WidgetHistory[Modifiedby]) can’t bring them back because removing a column filter does not undo a filter that removed rows via another column in the same table.
In other words, this is not a “ModifiedBy filter” problem; it’s a table-level row filter problem.
To fix it, you should explicitly tell Power BI to ignore all filters on the WidgetHistory table except the one you care about (CurrentStatusID = 23 and assignment logic), or reconstruct the filter context using ALLEXCEPT or REMOVEFILTERS at the table level.
Try the following:
Widgets at Status 23 :=
CALCULATE (
COUNTROWS ( WidgetHistory ),
WidgetHistory[CurrentStatusID] = 23,
REMOVEFILTERS ( WidgetHistory[ModifiedBy] )
)
If that still returns 396, it means the slicer is not filtering ModifiedBy directly, but filtering another column in WidgetHistory (for example AssignedTo or Name), which still removes those rows before the measure evaluates.
In that case, you should remove all table filters except the assignment column you actually want respected:
Widgets at Status 23 :=
CALCULATE (
COUNTROWS ( WidgetHistory ),
WidgetHistory[CurrentStatusID] = 23,
ALLEXCEPT (
WidgetHistory,
WidgetHistory[AssignedTo]
)
)
This tells Power BI: “Respect who the widget is assigned to, but ignore who modified it and any other columns in this table.”
If your slicer is on a separate Users table (recommended model design), then the solution becomes:
Widgets at Status 23 :=
CALCULATE (
COUNTROWS ( WidgetHistory ),
WidgetHistory[CurrentStatusID] = 23,
REMOVEFILTERS ( WidgetHistory[ModifiedBy] )
)
If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.
hth
Marcin