Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
power-bi-noob
Helper I
Helper I

Get same results in Power BI as Microsoft Access

I have 3 tables: courses_dim, enrollments_dim, and users_dim.

courses_dim & users_dim are related by enrollments:

powerbinoob_0-1667329659746.png

I am attempting to create a table that shows how many courses each instructor has.

I added the instructor's name and a measure of Courses Per Instructor = COUNTROWS(course_dim). Additionally, I added a filter for the enrollment type of "TeacherEnrollment", which should remove all student names. However, this filter DOES NOT remove the students, they still show up in the list.

Here is the table that shows my results in PowerBI. Notice Courses Per Instructor shows the sum of all courses in the system as opposed to the actual courses per instructor. Note: I have filtered this also based on name (Contains Demo) to remove any personal identifying information:

powerbinoob_1-1667330006824.png

Here are the results if I try the same thing in Microsoft Access (these results are correct):

powerbinoob_2-1667330025605.png

This is the visual design of the query in Access:

powerbinoob_3-1667330045158.png

 

Here is the SQL query:

SELECT User_dim.name AS User_dim_name, Count(Course_dim.name) AS Course_dim_name
FROM User_dim INNER JOIN (Course_dim INNER JOIN Enrollment_dim ON Course_dim.[id] = Enrollment_dim.[course_id]) ON User_dim.[id] = Enrollment_dim.[user_id]
GROUP BY User_dim.name, Enrollment_dim.type
HAVING (((User_dim.name) Like "*demo*") AND ((Enrollment_dim.type) Like "*teacher*"));

 

How can I recreate this result in PowerBI?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@power-bi-noob , Try a measure like

 

Count(Enrollment_dim[course_id])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@power-bi-noob , Try a measure like

 

Count(Enrollment_dim[course_id])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

That worked! Thanks @amitchandak !

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.