Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Calculating the number of days worked per person but with multiple lines per day

Hi All,

 

I'm looking to create a measure that counts the number of days a worker has worked in a period. This would be easy enough but the data is set up so that if a worker does enough hours to get overtime, there will be a new line for each over time rate as below:

 

 

WorkerDateRateHours
Tom23/06/20221.5x1
Tom23/06/20221x4
John23/06/20221x8
John23/06/20221.5x2
John21/06/20221x6
John22/06/20221x7

 

In this example Tom would have worked 1 day and John 3 days.

 

The end goal is working out the average number of days worked over a period, so in this example the average days worked would be 2 days. We could then track this over the entire workforce in a line graph for example.

 

Is this possible in DAX?

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , Try like

averagex(Values(Table[Worker]), calculate( Countrows(Summarize(Table, Table[Worker], Table[Date]))))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors