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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
BPNJMC
Frequent Visitor

Power BI DAX Functions not Working Because of Star Schema Relationships

I've been trying to create my first star schema based on Google Classroom data for a week.  

 

I’ve spent countless hours of Googling sites/pages like these and others:

https://docs.microsoft.com/en-us/power-bi/guidance/star-schema 

https://exceleratorbi.com.au/the-optimal-shape-for-power-pivot-data/

https://radacad.com/power-bi-basics-of-modeling-star-schema-and-how-to-build-it 

 

Here is a picture of my latest attempt:

 

Star Schema Attempt (1).jpg

 

 

 

I have a table visual that shows CourseName, StudentsEnrolled (it works)

StudentsEnrolled = CALCULATE(DISTINCTCOUNT(gc_FactSubmissions[StudentUserID]))

 

I am trying to create a table visual that shows StudentFullName, CourseWorkTitle, PointsEarned, MarkPct.

MarkPct = divide(sum(gc_FactSubmissions[SubmissionAssignedGrade]),sum(gc_DimCourseWork[MaxPoints]))

 

When I try to add StudentName to the visual, I end up with incorrect results (some blank student names and incorrect totals).

 

When I try to use DAX Related() to add StudentName, I can only select fields in the Submissions table.  From my reading, this means that there is a problem with my relationships.

 

I think the problem might be the gc_DimStudents table because it contains a student record for every student that is enrolled in gc_DimCourses.  Not all students enrolled have submitted assignments, so if I limited the gc_DimStudents to only the StudentUserIDs in gc_FactSubmissions, then I won’t be able to get a count of StudentsEnrolled in courses.

 

I’m not sure how to resolve this. Should I make gc_DimCourses into a 2nd fact table? Do I need two student tables, like gc_DimCourseStudents and a gc_DimSubmissionStudents?  

 

I want to keep building on one star schema model because we want reports/dashboards that relate things like online marks, to attendance, to disciplinary actions, etc., etc. So I want to get the relationships correct this time.

 

Any help is very appreciated.

Thanks, JMC

2 REPLIES 2
Anonymous
Not applicable

Hi @BPNJMC,

I agree with Greg_Deckler, it probability related to your relationship directions. You can check the below blog to know more about relationship directions.

What is the Direction of Relationship in Power BI? 

Regards,

Xiaoxin Sheng

Greg_Deckler
Community Champion
Community Champion

@BPNJMC Try changing your relationship directions to Both?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.