Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Student
Student Number | Student | School | School id | Caucasion | African | Indigenous |
654651654 | Jim Jones | ABC Elementary | 150 | 0 | 0 | 1 |
845484654 | Jen Jims | ABC Elementary | 150 | 0 | 0 | 1 |
984654984 | Kim Steves | ABC Elementary | 150 | 0 | 1 | 0 |
School
School | School Number | District |
ABC Elementary | 150 | North |
Attendance
District | School | Student Number | Absences |
North | ABC Elementary | 654651654 | 6 |
North | ABC Elementary | 845484654 | 5 |
North | ABC Elementary | 984654984 | 3 |
I have 3 tables like above, related like this:
Active Schools 1 <-----> Many Active Students on School ID
Active Students 1 < ---> 1 Attendance on Student ID
This is one to one because when the data was pulled from our Student info it was aggregated per student by late, Absent, Religious holiday etc to make pulling data easier.
So my questions is how can I take a total sum on the attendance grouped by Demographic.
The result should be
African - 3
Indigenous - 11
Caucasian - 0
I feel like this requires more advanced Dax expressions that i am not familiar with but please any solution i would love!
Solved! Go to Solution.
The DAX is always easier when you have the correct table structure. Can a student have a 1 for more than one demographic? If not, I suggest you use Power Query to add a single new column that contains the word relating to each student. Then with the mode l you have, the DAX will be a simple sum.
The DAX is always easier when you have the correct table structure. Can a student have a 1 for more than one demographic? If not, I suggest you use Power Query to add a single new column that contains the word relating to each student. Then with the mode l you have, the DAX will be a simple sum.
Yes unfortunately some students can Identify as more than one demographic where a 1 will be populated in the corresponding column.
Then what is the total to be if a student has 1 in a second column? Regardless, I would then change the model. This is how I would do it
create a unique student table without the demographic columns
create a second table called demographics. Unpivot the demographic columns and remove the zeros.
join the first table to the second 1:many
turn in BI directional filtering (assuming performance is not impacted). Less than 1m students should be fine.
use the attribute column from the demographic table - it should just work, not withstanding my opening question
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
97 | |
85 | |
67 | |
59 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |