Hello,
My worksheet has these 2 tables: (Title is blank whenever Special Title is not)
The relationship to Assigned City Key is inactive:
These are my measures:
Current non-accountants:=CALCULATE(COUNTROWS(Employees);
Employees[Title] <> "Accountant";
Employees[Title] <> BLANK()
)
Assigned non-accountants:=CALCULATE([Current non-accountants]; USERELATIONSHIP(Employees[Assigned City Key]; Cities[City Key]))
And the resulting pivot:
If, however, I change the "Current non-accountants" measure to use FILTER instead of boolean arguments to CALCULATE, like this...
Current non-accountants:=CALCULATE(COUNTROWS(Employees);
FILTER(Employees;
Employees[Title] <> "Accountant" &&
Employees[Title] <> BLANK()
)
)
... then I get wrong results for "Assigned non-accountants" in the pivot:
I'm aware that the FILTER version will keep the current filter context for the Title column, unlike the FILTER-less version. But that should not be an issue since there's no filter context on Title to begin with.
If I change the active relationship, then Assigned non-accountants will give the correct results for both versions (and Current non-accountants, of course, will be equal to Assigned non-accountants).
Can someone please clarify this behavior?
My worksheet has these 2 tables: (Title is blank whenever Special Title is not)
The relationship to Assigned City Key is inactive:
These are my measures:
Current non-accountants:=CALCULATE(COUNTROWS(Employees);
Employees[Title] <> "Accountant";
Employees[Title] <> BLANK()
)
Assigned non-accountants:=CALCULATE([Current non-accountants]; USERELATIONSHIP(Employees[Assigned City Key]; Cities[City Key]))
And the resulting pivot:
If, however, I change the "Current non-accountants" measure to use FILTER instead of boolean arguments to CALCULATE, like this...
Current non-accountants:=CALCULATE(COUNTROWS(Employees);
FILTER(Employees;
Employees[Title] <> "Accountant" &&
Employees[Title] <> BLANK()
)
)
... then I get wrong results for "Assigned non-accountants" in the pivot:
I'm aware that the FILTER version will keep the current filter context for the Title column, unlike the FILTER-less version. But that should not be an issue since there's no filter context on Title to begin with.
If I change the active relationship, then Assigned non-accountants will give the correct results for both versions (and Current non-accountants, of course, will be equal to Assigned non-accountants).
Can someone please clarify this behavior?