Forum Discussion
Filter a table by another table
Hi
I have Reporting Table that containes Customer IDs and a Customer Table that also contains Customer IDs.
I want to filter my Reporting Table to only show the Customers that exist in the Customer Table.
Can you please help???
It should be possible to pull the Customer ID field from the Customer table onto a visualisation and then add anything from the report table. This will only show records from customers that exist in both.
A DAX way to find a list would be something like
Table = FILTER(VALUES(Reporting[CustomerID]), CALCULATE(COUNTROWS(Customer) > 0))
This is a bit like an EXISTS query in SQL
3 Replies
- HotChilliCommunity Champion
Do you have a relationship linking the 2 tables on customer id?
- AnonymousNot applicable
Yes a many to many relationship
- HotChilliCommunity Champion
It should be possible to pull the Customer ID field from the Customer table onto a visualisation and then add anything from the report table. This will only show records from customers that exist in both.
A DAX way to find a list would be something like
Table = FILTER(VALUES(Reporting[CustomerID]), CALCULATE(COUNTROWS(Customer) > 0))
This is a bit like an EXISTS query in SQL