Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
I have 3 tables:
1) Territories
2) Doctors
3) Visits
Territories filters Doctors based on TerritoryCodes, and Doctors filters Visits based on DoctorKeys. There is an inactive relationship between Territories and Visits based on TerritoryCodes as well.
The Visits table has some DoctorKeys that are missing in the Doctors table.
I have created 3 COUNTROWS measures:
[ActualCalls] =
COUNTROWS ( 'Visits' )
[ActualCallsTREATAS] =
CALCULATE (
COUNTROWS ( 'Visits' ) ,
TREATAS ( VALUES ( 'Territories'[Territory] ) , 'Visits'[Territory] ) )
[ActualCallsUSERELATIONSHIP] =
CALCULATE (
COUNTROWS ( 'Visits' ) ,
USERLATIONSHIP ( 'Territories'[Territory] , 'Visits'[Territory] ) )
The measures give the following results:
As expected, ActualCalls show 1,266 visits against a blank row due to the missing DoctorKeys in the Doctors table. But I expected TREATAS and USERELATIONSHIP to both be able break down those calls as the Territories table contains all the territories found in the Visits table. USERELATIONSHIP does this well, but TREATAS fails to pull in the required values (but still shows the same total as the other measures).
Can anyone please help explain what's going on?
Solved! Go to Solution.
First, the totals all being the same makes sense because, in the total line, there is no filtering happening related to territory. The filtering paths don't matter since they aren't being used.
Now, what's up with TREATAS? In this measure, the Doctors table is still filtering Visits but now you've added an additional filter on top of that. In particular, Visits is still limited to the rows that match the Doctors table (which is why you don't see the 1,266 in the blank row). If you insert ALL ( Doctors ) into the TREATAS measure, then it'll probably match the USERELATIONSHIP measure.
First, the totals all being the same makes sense because, in the total line, there is no filtering happening related to territory. The filtering paths don't matter since they aren't being used.
Now, what's up with TREATAS? In this measure, the Doctors table is still filtering Visits but now you've added an additional filter on top of that. In particular, Visits is still limited to the rows that match the Doctors table (which is why you don't see the 1,266 in the blank row). If you insert ALL ( Doctors ) into the TREATAS measure, then it'll probably match the USERELATIONSHIP measure.
Thanks Alexis!
I'd thought TREATAS would replace any existing filters and bypass existing relationships, but the ALL('Doctors') or REMOVEFILTERS('Doctors') does the trick 👍
User | Count |
---|---|
12 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
19 | |
14 | |
10 | |
7 |