Forum Discussion
zrnooredeen
6 years agoRegular Visitor
How to get Average column to sum correctly
I am working with one excel workbook that has one sheet. There are clients and personnel who work on multiple clients. In power BI, I have a table showing: the personnel, the total number of hours ea...
- 6 years ago
parry2k I manage to get the correct average per client to calculate and the correct totals in each column. The thing is I don't understand how or why this works. In addition, can you please elaborate more on your first post as to why the average don't simply work?
This was the formula I ended up using:
Average Hours Per Partner =if(hasonevalue(Sheet1[Personnel]),DIVIDE(SUM('Sheet1'[Total Hours]), [Number of Partners Worked on]),sumx(values(Sheet1[Personnel]),CALCULATE([Hours]/[Number of Partners Worked on])))
parry2k
Super User
6 years agozrnooredeen sorry I missed to post the DAX measure expression. here it is
Distinct Client (Revised) =
SUMX ( VALUES ( 'Table'[Person] ),
CALCULATE ( DISTINCTCOUNT ( 'Table'[Client] ) )
)
zrnooredeen
6 years agoRegular Visitor
parry2k I manage to get the correct average per client to calculate and the correct totals in each column. The thing is I don't understand how or why this works. In addition, can you please elaborate more on your first post as to why the average don't simply work?
This was the formula I ended up using:
Average Hours Per Partner =
if(hasonevalue(Sheet1[Personnel]),DIVIDE(SUM('Sheet1'[Total Hours]), [Number of Partners Worked on]),sumx(values(Sheet1[Personnel]),CALCULATE([Hours]/[Number of Partners Worked on])))
- v-lili6-msft6 years ago
Community Support
hi zrnooredeen
This looks like a measure totals problem. Very common. See this post about it
https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907Regards,Lin