Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
LangeJan
Helper I
Helper I

Count 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
LangeJan_0-1647888527420.png

 

Here the count does not work with data TDCID from 'REFERENCE' table

LangeJan_1-1647888761242.png

 

 
5 REPLIES 5
tamerj1
Super User
Super User

@LangeJan 

You can try

VATNUM occurrences =
CALCULATE (
    COUNTROWS ( AXtest_CUSTTABLE );
    ALL ( AXtest_CUSTTABLE );
    VALUES ( AXtest_CUSTTABLE[VATNUM] );
    REMOVEFILTERS ( References )
)

 

 

 

@tamerj1 Thanks for your suggestion. Unfortunately this does not solve the problem.

@LangeJan 

Sorry for that. 
try to CROSSFILTER the relationship to "None"

Or otherwise, you can add it as measure not a column. Can you please share a screenshot of you data model (relationships) and provide the names of the tables and involved columns?

tamerj1
Super User
Super User

Hi @LangeJan 

Do you have a relationship between the two tables?

Yes I have a relationship between the two tables. There is no data in Tdcid for the mentioned vatnumber.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.