Forum Discussion
Calculate course hours
Hello everyone. I have the following problem. I have an excel database with the actions performed by each student. This is the fact table. The dimension table is student and teacher. In each record of facts it puts the day that the formative action is carried out, start time, end, course, if the action is group or individual and the teacher who imparts the action. Now I want to know the total number of hours taught by each teacher, but as a sum of the hours per course, calculate the sum of the hours of each student with which a course of 5 hours for ten students, tells me that the teacher has taught 50 hours, when in fact he has taught 5. I attach the table.
I've tried to solve it in many ways. For example, calculating the sum of all course hours per student, divided by the number of students per course day, but still adding the total hours per student. I attach the pivot table.
As you can see the number of students, the total hours per class, but I divide the hours by the students. A help please.
1 Reply
- Greg_Deckler
Community Champion
Syndicate_Admin Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.