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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
mistahk
Regular Visitor

Get weekly average of users

Hi,

 

I'm needing to captue the weekly (weekday) average number of users who have badged into the office.

 

I've used this guide and while it works great, it only divides by the number of days there are data. If no one is in the office on Friday, it divides the data by 4 (Monday to Thursday) instead of the 5 (Monday to Friday) thus skewing the numbers.

https://blog.enterprisedna.co/copy-calculating-average-in-power-bi-isolating-weekday-or-weekend-resu...

DateLocationUser
June 12th, 2023WashingtonJane Doe
June 12th, 2023WashingtonBilly Bob
June 13th, 2023WashingtonJane Doe
June 13th, 2023WashingtonBilly Bob
June 13th, 2023WashingtonVictor Smith
June 13th, 2023WashingtonSam Anderson
June 14th, 2023WashingtonVictor Smith
June 14th, 2023WashingtonSam Anderson
June 15th, 2023WashingtonVictor Smith
June 15th, 2023WashingtonSam Anderson

 

Current:

Weekday Average 10/4 = 2.5

 

Expected

Weekday Average 10/5 = 2.0

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @mistahk ,

 

Please try this measure:

 

Weekday Average = var _days=CALCULATE(COUNT('Table'[Date]),ALLSELECTED('Table'))
return DIVIDE(_days,5)

 

 

If you also need to calculate by weekly grouping, try this:

 

Weekday Average Grouping = var _days=CALCULATE(COUNT('Table'[Date]),FILTER(ALLSELECTED('Table'),[Weeknum]=MAX('Table'[Weeknum])))
return DIVIDE(_days,5)

 

vstephenmsft_0-1688090727308.png

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @mistahk ,

 

Please try this measure:

 

Weekday Average = var _days=CALCULATE(COUNT('Table'[Date]),ALLSELECTED('Table'))
return DIVIDE(_days,5)

 

 

If you also need to calculate by weekly grouping, try this:

 

Weekday Average Grouping = var _days=CALCULATE(COUNT('Table'[Date]),FILTER(ALLSELECTED('Table'),[Weeknum]=MAX('Table'[Weeknum])))
return DIVIDE(_days,5)

 

vstephenmsft_0-1688090727308.png

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.