Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi!
I have two tables, Order Table and Item Table, both of which have the same primary key which is customer ID.
Both tables have a column which are similar but because of the way the database has been designed, they stand alone. Both have the column 'item colour'.
I need to a distinct count of the Customer ID's where they have both ordered a blue item colour but I'm struggling to write a measure which will look at both tables and filter both tables on the columns I need.
any help would be much appreciated!
Solved! Go to Solution.
Hi @Anonymous ,
Based on your description,, Please try code as below.
My Sample:
Order Table:
Item Table:
Distinct Blue Customers =
VAR _OrderTableBlue = CALCULATETABLE(
VALUES('Order Table'[Customer ID]),
FILTER(
'Order Table',
'Order Table'[Item Colour] = "Blue"
)
)
VAR _ItemTableBlue = CALCULATETABLE(
VALUES('Item Table'[Customer ID]),
FILTER(
'Item Table',
'Item Table'[Item Colour] = "Blue"
)
)
RETURN
COUNTROWS(
INTERSECT(
_OrderTableBlue,
_ItemTableBlue
)
)
Result is as below.
If this reply still couldn't help resolve your issue, please provide detailed sample data and the results you are hoping for. We can better understand the problem and help you. Show it as a screenshot or excel. Please remove any sensitive data in advance.
Best Regards,
Yulia Yan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Based on your description,, Please try code as below.
My Sample:
Order Table:
Item Table:
Distinct Blue Customers =
VAR _OrderTableBlue = CALCULATETABLE(
VALUES('Order Table'[Customer ID]),
FILTER(
'Order Table',
'Order Table'[Item Colour] = "Blue"
)
)
VAR _ItemTableBlue = CALCULATETABLE(
VALUES('Item Table'[Customer ID]),
FILTER(
'Item Table',
'Item Table'[Item Colour] = "Blue"
)
)
RETURN
COUNTROWS(
INTERSECT(
_OrderTableBlue,
_ItemTableBlue
)
)
Result is as below.
If this reply still couldn't help resolve your issue, please provide detailed sample data and the results you are hoping for. We can better understand the problem and help you. Show it as a screenshot or excel. Please remove any sensitive data in advance.
Best Regards,
Yulia Yan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 6 | |
| 5 | |
| 5 |
| User | Count |
|---|---|
| 24 | |
| 11 | |
| 9 | |
| 9 | |
| 8 |