Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
I have data that looks like this:
| names | hours |
| diego | 1 |
| diego | 1 |
| diego | 1 |
| brittney | 4 |
I want to take the average hours per employee, but there are entries that have the same person's name repeated with small amounts of hours. In a perfect world, they would already all be added. So, to avoid having to edit the excel sheet. Is there a measure dax code I can use that would first add all the hours with the same person's name, and then take the average?
I was thinking of using AVERAGEX(SUMMARIZE('TABLE1', 'TABLE1'[COLUMN1], 'TABLE1'[COLUMN2),'TABLE1'[COLUMN2])
However, I am not sure this is giving me the correct values back. Any help?
TL;DR How do I add all the hours with the same names firstm
@Anonymous ,
There are various ways to solve this. Easiest way I think is:
Average = DIVIDE( SUM( 'Table'[hours] ),
DISTINCTCOUNT( 'Table'[names] ),
0 )
This will give you 7 / 2 = 3.5 hours.
Hope this will work with your full dataset.
Regards,
Yes, but I wanted to have the sum every value for the same person as well.
What would that be?
@Anonymous ,
Hours_Sum = CALCULATE( SUM( 'Table'[hours] ),
ALLSELECTED( 'Table'[names] ))
Is this what you are looking to achieve?
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 83 | |
| 48 | |
| 36 | |
| 31 | |
| 29 |