- 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

Get count of assignments in courses
I have two tables (courses, assignments) that are related by the course id. I can easily create a table showing a list of courses and all of the assignments in each course. What I'd really like to do is have a table that shows the number of assignments in each course.
So instead of:
course 1, assignment 1
course 1, assignment 2
course 1, assignment 3
course 1, assignment 4
course 2, assignment 1
course 2, assignment 1
I'd like:
course 1, 4
course 2, 2
What sort of DAX magic would I need to make this happen? Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Create a measure like
Num assignments = COUNTROWS(Assignments)
and add that to a visual with the course name column from the courses table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Create a measure like
Num assignments = COUNTROWS(Assignments)
and add that to a visual with the course name column from the courses table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

All that does is add a 1 at the end of each assignment, so now I get:
course 1, assignment 1, 1
course 1, assignment 2, 1
course 1, assignment 3, 1
course 1, assignment 4, 1
course 2, assignment 1, 1
course 2, assignment 1, 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

remove the assignment name column from the table visual
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

I actually just figured that out a split second after my post. Thanks!

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

Subject | Author | Posted | |
---|---|---|---|
02-13-2025 02:25 PM | |||
09-10-2024 01:41 AM | |||
03-14-2022 03:18 PM | |||
10-18-2024 09:04 AM | |||
12-18-2024 11:30 PM |
User | Count |
---|---|
86 | |
81 | |
53 | |
37 | |
37 |