To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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:
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
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
@BPNJMC Try changing your relationship directions to Both?
User | Count |
---|---|
3 | |
3 | |
2 | |
2 | |
2 |
User | Count |
---|---|
9 | |
7 | |
6 | |
5 | |
4 |