Hello Everyone!
I'm stumped, the below table represents employees (ID Column) and their corresponding production totals. I am wanting to create an expression or workflow where I can sum and average the duplicate ID's corresponding hours. Im stuck at the start line and dont even know where or how to begin.
Crew | ID | Name | BPH | Boxes Pick | Hours | Date |
Crew: GS5 | 82287 | ROSAS CASTILLO JOSE | 6.92 | 3 | 0.43 | 4/30/2022 |
Crew: GS5 | 82287 | ROSAS CASTILLO JOSE | 11.51 | 33 | 2.87 | 4/30/2022 |
Crew: GS5 | 93675 | FILOMON OROPEZA VICTOR | 6.92 | 3 | 0.43 | 4/30/2022 |
Crew: GS5 | 93675 | FILOMON OROPEZA VICTOR | 13.95 | 40 | 2.87 | 4/30/2022 |
Crew: GS5 | 97248 | JIMENEZ RUIZ FERMIN RICARDO | 4.62 | 2 | 0.43 | 4/30/2022 |
I would like to end up with each ID's hourly sum but there are various rows w/ the same ID.
Any help!
Solved! Go to Solution.
If you want to avoid duplicates (no duplicate ID + Date rows) in the first place then this article will help.
If employees entering multiple rows on a given day is allowed then you can get the average by
AVERAGE(
SELECT(
tableName[Hours],
AND(
[ID] = [_THISROW].[EmpID]
[Date] = [_THISROW].[DateToCalculate]
)
)
I am assuming that you have a table that stores the sum/average hours of workers each day consisting these cols.
[rowID], [DateToCalculate], [EmpID], [Daily SUM], [Daily Average]
Just replace AVERAGE with SUM for [Daily SUM]
If you want to avoid duplicates (no duplicate ID + Date rows) in the first place then this article will help.
If employees entering multiple rows on a given day is allowed then you can get the average by
AVERAGE(
SELECT(
tableName[Hours],
AND(
[ID] = [_THISROW].[EmpID]
[Date] = [_THISROW].[DateToCalculate]
)
)
I am assuming that you have a table that stores the sum/average hours of workers each day consisting these cols.
[rowID], [DateToCalculate], [EmpID], [Daily SUM], [Daily Average]
Just replace AVERAGE with SUM for [Daily SUM]
Thank You!
User | Count |
---|---|
15 | |
15 | |
8 | |
7 | |
4 |