Forum Discussion

KylePalardy's avatar
KylePalardy
Regular Visitor
1 month ago
Solved

Calculating with Filters

I am trying to calculate the percentage of work that each employee does on each project. I need the individual hours on each project divided by the total hours from each project. I am getting an erro...
  • jgeddes's avatar
    1 month ago

    Consider the example data...

    You can get the % of hours by each lead (indicated here as ABC, DEF, etc.) using the context of the visual and the following measure...

    %_Hours_Project = 
    DIVIDE(
        CALCULATE(SUM('Table'[Hours])),
        CALCULATE(SUM('Table'[Hours]), ALLEXCEPT('Table', 'Table'[ProjectCode])),
        0
    )

    To get this result...