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

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.

Reply
mami
New Member

Calculat of distant related values

I would like to calculat of distant related values, can someone please tell me how to do it?
This is my scenario and the table

 

3 main table

School

School_cdSchool_name
100School0
101School1
102School2
103School3

 

Student

HW: If homework is done 1, if not 0

student_cdstudent_name

HW

300student_01
301student_11
302student_21
303student_30
304student_40
305student_51

 

manager

manager_cdmanager_name
200manager0
201manager1


In addition to the above, there are two other tables.

School_manager

school_cdAreamanager_cd
100A200
101A200
102B200
103B201


School_Student

The student belongs to only one main school, and the main school is flagged 1 for "main_school_flag".

school_cdstudent_cdmain_school_flag
1003001
1003011
1013000
1013021
1023000
1023031
1023041
1033051

 

The result I want to get is the number of students in each manager who are doing and not doing their homework.

Students attend more than one school and I would like to count them in the main school.
Since a manager may be responsible for more than one area, we also output the areas.

 

Areamanager_cdHW donenot yetschool
A2003 100,101
B200 2102
B2011 103

 

1 ACCEPTED SOLUTION

@mami 
Please refer to attached sample file with the solution

1.png2.png

View solution in original post

6 REPLIES 6
tamerj1
Super User
Super User

Hi @mami 

how are these tables connected? Can you please share a screenshot of tge dara model showing the relationships?

@tamerj1 
Thank you for your help.

This is how I connect.

mami_0-1674998166383.png

mami_1-1674998248607.png

 

@mami 
Please refer to attached sample file with the solution

1.png2.png

@tamerj1 
Thank you for your help!

This was very helpful😆

I didn't know crossfilter😅

@mami 
However, I have to say that School_Manage table is better to be part of the School table. There is absolutely no point of having two tables while adding few columns will do exactly the same job even more efficiently.

@tamerj1 
thank you for your advice.

You are correct.School table was meaningless.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors