Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
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 error message that there is a calculation error that cannot convert the column with the employee name (LeadDeveloper) to true and false. Im not sure how to fix the dax measure or the columns to properly calculate this.
Solved! Go to Solution.
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...
Proud to be a Super User! | |
I split it into three simple measures. Instead of filtering manually, I let the visual's row context (EMP + Project) handle the base calculation, then used ALL(P_data[EMP]) to remove just the employee filter so I get the project's total across everyone:
Total_Hrs = SUM(P_data[Actual_Hrs])
Project Hrs = CALCULATE([Total_Hrs], ALL(P_data[EMP]))
%_of_Hours_by_EMP = DIVIDE([Total_Hrs], [Project Hrs], -1)
Result:
EMP Project Total_Hrs Project Hrs %_of_Hours_by_EMP
Each employee's share of a project's total hours now adds up to 100% per project as expected.
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...
Proud to be a Super User! | |
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.