Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi how can I convert this Calculation from Count of Employees into an Average Number of Employees calculation?
THe calculation needs to find out the average amount of employess that have worked more than 5 hrs over their standard time, indicated by: (rep_timesheet_OVT[OT 5HRS PlUS] =1 ).
I tired a few variations, but where I am not sure is :
how to deal with the distinctcount, which is required to calculate the proper number of total employees.
Solved! Go to Solution.
Try the following formula:
% Share =
VAR Volume =
CALCULATE ( DISTINCTCOUNT( rep_timesheet_OVT[Employee ID]),FILTER ( rep_timesheet_OVT, rep_timesheet_OVT[OT 5HRS PlUS] =1 ))
VAR AllVolume =
CALCULATE ( DISTINCTCOUNT(rep_timesheet_OVT[Employee ID]), ALL('rep_timesheet_OVT' ) )
RETURN
DIVIDE ( Volume, AllVolume )
Brilliant, thank you!
I have one question, what is exactly the difference
between:
I don't quite get what the , ALL('rep_timesheet_OVT' at the end does?
Thank you
Hello @acg
If you use ALL in a CALCULATE function you simply say to the formula to do calculations on all the rows in the table ignoring any filters.
This means that if you have a table with 3 employee types; A, B and C then this formula will return the sum of all employees across all categories
Try the following formula:
% Share =
VAR Volume =
CALCULATE ( DISTINCTCOUNT( rep_timesheet_OVT[Employee ID]),FILTER ( rep_timesheet_OVT, rep_timesheet_OVT[OT 5HRS PlUS] =1 ))
VAR AllVolume =
CALCULATE ( DISTINCTCOUNT(rep_timesheet_OVT[Employee ID]), ALL('rep_timesheet_OVT' ) )
RETURN
DIVIDE ( Volume, AllVolume )
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
8 | |
8 | |
8 | |
6 |
User | Count |
---|---|
14 | |
12 | |
11 | |
10 | |
8 |