Each fact or wide table contains one or more measures relative to a specific thing. For example, wide_student_school_attendance is measuring a student’s school (daily) attendance while wide_student_grade is measuring a student’s overall performance in a course section. There may be additional wide tables that go deeper to look at things like course section (period) attendance or course section assignments. Metrics build upon these tables by providing meaning through adding context. Let’s look at an example.

Looking again at our wide_student_school_attendance table, we see our dimensions such as student name and our measures such as attendance_duration.

student_last_namestudent_first_nameschool_yearcalendar_dateattendance_codeattendance_durationabsence_duration
PotterHarry20252024-09-09P10
PotterHarry20252024-09-10P10
PotterHarry20252024-09-11EA01
PotterHarry20252024-09-12P10
PotterHarry20252024-09-13T10

In this table, we can see that Harry Potter has a attendance_duration of 1 for each day he was present. We can also see that he has an absence_duration of 1 when absent. These are the measures. Metrics provide context to these measures. For example, we could create a metric called average daily attendance (attendance rate) which is calculated as the sum of attendance_duration divided by the number of records for Harry. This metric would provide a percentage of the time Harry Potter was present at school. This is just one example of how metrics can provide meaning to the raw measures in our wide tables.

Below is how we approach metrics for those using Looker Studio and Tableau. If you use Lightdash, we use a different approach.

Metrics surface in tables prefixed with metrics_ and located in the prod_metrics dataset.

TableDescription
metrics_studentOne row per student + school year + metric. This tables contains student metrics specific to a school year. Most metrics are typically located here.
metrics_student_grading_periodOne row per student + school year + grading period + metric. This table contains student metrics specific to a school year and grading period. For example, 2024 S1 GPA.

Here is an example of what your metrics_student table might look like:

student_last_namestudent_first_nameschool_yearmetric_categorymetric_namemetric_valuemetric_labelhas_met_goal
PotterHarry2024AttendanceAverage Daily Attendance0.96On Track1
PotterHarry2024AttendanceAbsence Rate0.04On Track1
PotterHarry2023AttendanceAverage Daily Attendance0.85At Risk0
PotterHarry2024AcademicUnweighted Current GPA3.4On Track1
PotterHarry2024AcademicPercent of Passing Classes0.95On Track1