Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have two columns, each from a different table that are linked. I want to find the count of how many distinct and similar values are between the columns.
For example if one table had a column with values: [chicken, fish, rice, tree, car] and the other table's column had the values [fish, boat, rice, rice, ears, mouse], I would want the count to be 2 because rice and fish show up in both columns.
Edit: I was thinking something along the lines of a distinctcount and an innerjoin. I can't get it to work
Solved! Go to Solution.
Hi @goalie_ ,
You can try a measure
// Given: T1 and T2 that are somehow linked
// meaning a filter can be applied to both
// tables at the same time. We're interested
// in T1[col] and T2[col].
[# Same Values] =
COUNTROWS(
INTERSECT(
VALUES( T1[col] ),
VALUES( T2[col] )
)
)
Best
D
Hi @goalie_ ,
You can also have a look at this article
https://www.sqlbi.com/articles/from-sql-to-dax-joining-tables/
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Hi @goalie_ ,
You can try a measure
User | Count |
---|---|
14 | |
9 | |
7 | |
7 | |
6 |
User | Count |
---|---|
21 | |
11 | |
10 | |
10 | |
8 |