- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Compare one to many column values between two tables
Hello,
I have a Students table that lists each UserID value once.
I want to know in a new column in the Students table if the UserID field has any matching values in the Infractions table.
It can either be the UserID value or a 1 for a match or a 0 for a non-match.
In the Infractions table, there can be many rows or no rows at all that match the UserID field from the Student table.
PBIX file with two tables mentioned above
Click the download icon to save the file
Excel example of the result I am looking for.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Thank you for posting the data.
If you want to create a calculated column in the Students table, the existing relationship makes things reasonably straightforward.
NewCol = CALCULATE(COUNT(Infractions[Infraction]))
Let me know if that helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

@HotChilli That worked perfectly! Thank you very much for your time and expertise. I like that it gave me a count of the infractions. Take care!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Thank you for posting the data.
If you want to create a calculated column in the Students table, the existing relationship makes things reasonably straightforward.
NewCol = CALCULATE(COUNT(Infractions[Infraction]))
Let me know if that helps.

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
01-16-2024 01:26 AM | |||
07-04-2024 04:53 AM | |||
03-24-2024 09:14 PM | |||
03-21-2024 02:58 AM | |||
05-06-2024 02:41 AM |
User | Count |
---|---|
141 | |
110 | |
81 | |
61 | |
46 |