Forum Discussion

b-kopik's avatar
b-kopik
Helper III
6 months ago
Solved

Best Data Model for Headcount (Monthly) and Course Data in Power BI

I’m working with two datasets in Power BI that both contain multiple rows per employee, but represent different types of information. Dataset 1: Combined Headcount Data Every month, I l...
  • v-hashadapu's avatar
    v-hashadapu
    4 months ago

    Hi b-kopik ,

    If you want to count how many courses were taken, try something like:

    CoursesTaken :=
    CALCULATE (
    COUNTROWS ( 'Campus Data' ),
    TREATAS (
    VALUES ( 'Combined Headcount'[Employee ID] ),
    'Campus Data'[Employee ID]
    )
    )

    or if you want number of employees trained, try something like:

    EmployeesTrained :=
    CALCULATE (
    DISTINCTCOUNT ( 'Campus Data'[Employee ID] ),
    TREATAS (
    VALUES ( 'Combined Headcount'[Employee ID] ),
    'Campus Data'[Employee ID]
    )
    )