Forum Discussion
LangeJan
Helper I
4 years agoCount not working when joining with other table
Hi
I have two tables. 'CUSTOMERS' and 'REFERENCE'.
I have made a count of how many times a VATNUMBER occurs in 'CUSTOMERS'. The count works fine, right up until I add data from the 'REFERENCE' table.
Can anyone tell how I can keep the count even though I want to see data from both tables?
Thanks in advance.
VATNUM occurrences = CALCULATE(
COUNTROWS(AXtest_CUSTTABLE);
ALL(AXtest_CUSTTABLE);
VALUES(AXtest_CUSTTABLE[VATNUM])
)
Here the count works fine without data from 'REFERENCE' table
Here the count works fine without data from 'REFERENCE' table
Here the count does not work with data TDCID from 'REFERENCE' table
5 Replies
- LangeJan
Helper I
Yes I have a relationship between the two tables. There is no data in Tdcid for the mentioned vatnumber.
- tamerj1
Community Champion
You can try
VATNUM occurrences = CALCULATE ( COUNTROWS ( AXtest_CUSTTABLE ); ALL ( AXtest_CUSTTABLE ); VALUES ( AXtest_CUSTTABLE[VATNUM] ); REMOVEFILTERS ( References ) )