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 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more
Hi Community another day, another challenge 🙂
Need to acomplish this calculation...thanks for any help in advance!
| Date | MainWorker | Assistant | TotalItens | DefectoiTens | %Defecto | Desired Result = Sum all % results when the worker is Main or Assistant | %Total |
| day1 | employee1 | employee2 | 100 | 5 | 5% | Employee1 | 10% |
| day1 | employee3 | employee4 | 100 | 10 | 10% | Employee2 | 10% |
| day1 | employee5 | employee6 | 100 | 15 | 15% | Employee3 | 30% |
| day1 | employee7 | employee8 | 100 | 0 | 0% | Employee4 | 35% |
| day2 | employee2 | employee3 | 100 | 5 | 5% | Employee5 | 35% |
| day2 | employee4 | employee5 | 100 | 10 | 10% | Employee6 | 35% |
| day2 | employee6 | employee7 | 100 | 15 | 15% | Employee7 | 25% |
| day2 | employee8 | employee1 | 100 | 0 | 0% | Employee8 | 0% |
| day3 | employee6 | employee1 | 100 | 5 | 5% | ||
| day3 | employee7 | employee5 | 100 | 10 | 10% | ||
| day3 | employee3 | employee4 | 100 | 15 | 15% | ||
| day3 | employee2 | employee8 | 100 | 0 | 0% |
Solved! Go to Solution.
Calculation =
var helperTable = UNION(
SELECTCOLUMNS(ALL('Table'), "workers", 'Table'[MainWorker], "defecto", 'Table'[%Defecto]),
SELECTCOLUMNS(ALL('Table'), "workers", 'Table'[Assistant], "defecto", 'Table'[%Defecto])
)
return SUMX(FILTER(helperTable, [workers] = SELECTEDVALUE('Table'[MainWorker])), [defecto])Hope this helps.
Hi,
In the Query Editor, select all columns other than Main Worked and Assistant, right click and select Unpivot Other columns. Rename the Atribute column as Employees. Drag the Employees column to the visual and write this measure
Measure = sum(Data[%Defecto])
Hope this helps.
Calculation =
var helperTable = UNION(
SELECTCOLUMNS(ALL('Table'), "workers", 'Table'[MainWorker], "defecto", 'Table'[%Defecto]),
SELECTCOLUMNS(ALL('Table'), "workers", 'Table'[Assistant], "defecto", 'Table'[%Defecto])
)
return SUMX(FILTER(helperTable, [workers] = SELECTEDVALUE('Table'[MainWorker])), [defecto])Hope this helps.
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!
Check out the July 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 31 | |
| 28 | |
| 24 | |
| 24 | |
| 19 |
| User | Count |
|---|---|
| 44 | |
| 31 | |
| 17 | |
| 17 | |
| 15 |