I’m having an issue with a calculated field, with a goal to have a KPI visual that presents Average Wages per Employee.
My data has multiple rows of data per employee. I want to first sum the wages per employee, and then retrieve the average for all employees.
I was able to obtain the correct number in a tabular visual by grouping the data by EMPLOYEEID, and having the WAGES field be aggregated by “SUM” and the Total as “AVERAGE”.
However, when I use the below formula as a calculated field in a KPI visual, the result is off by 2-3%.
I used the following formula:
avg(sumOver(WAGES, [EMPLOYEEID], PRE_AGG))
The odd thing is that I can reproduce the right amount if I filter the data for groups of 2-3 EMPLOYEEIDs, but I can’t get the right number for the full population.
Does anyone have any ideas to help my troubleshoot?
Any guidance here is appreciated!
Thank you
