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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.