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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Matthew_Theis
Advocate II
Advocate II

Calculating Average Weekday Users per week

Hello Everyone, 

I'm interested in determining the Average number Users per weekday (ignoring Saturday && Sunday).  So for example below, I would have Sept 10 - Sept 14 aggregrations (DistinctCount) summed and then divided by 5 weekdays for an average of: 349.  I have a date table.  Can someone please help me with the DAX?  How can I attach my workbook for others to experiment with?

Thanks!

Matthew  Average Weekday Users per Week.PNGDate Table.PNG

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @Matthew_Theis,

 

Please check my steps as below.

 

1. Create a Calendar table and create some calculated column in the new table.

Calendar = CALENDARAUTO()
weekday = WEEKDAY('Calendar'[Date])
YearWeek = YEAR('Calendar'[Date])*100+WEEKNUM('Calendar'[Date])
users = CALCULATE(DISTINCTCOUNT('WebSpice Log'[IP]))
userswithworkdays = IF('Calendar'[weekday]=7 || 'Calendar'[weekday]=1,BLANK(),'Calendar'[users])

2. Then we can create a measure to achieve our goal.

 

average = CALCULATE(SUM('Calendar'[userswithworkdays]),ALLSELECTED('Calendar'),VALUES('Calendar'[YearWeek]))/5

Capture.PNGrela.PNG

 

For more details, please check the pbix as attached.

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

3 REPLIES 3
v-frfei-msft
Community Support
Community Support

Hi @Matthew_Theis,

 

Please check my steps as below.

 

1. Create a Calendar table and create some calculated column in the new table.

Calendar = CALENDARAUTO()
weekday = WEEKDAY('Calendar'[Date])
YearWeek = YEAR('Calendar'[Date])*100+WEEKNUM('Calendar'[Date])
users = CALCULATE(DISTINCTCOUNT('WebSpice Log'[IP]))
userswithworkdays = IF('Calendar'[weekday]=7 || 'Calendar'[weekday]=1,BLANK(),'Calendar'[users])

2. Then we can create a measure to achieve our goal.

 

average = CALCULATE(SUM('Calendar'[userswithworkdays]),ALLSELECTED('Calendar'),VALUES('Calendar'[YearWeek]))/5

Capture.PNGrela.PNG

 

For more details, please check the pbix as attached.

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Matthew_Theis
Advocate II
Advocate II

Here is a link to the .pbix.  Hopefully this will work.  I don't see a Choose File option as mentioned here

 

https://kemet-my.sharepoint.com/:u:/p/matthewtheis/ET6V5bSCcShLoG5bIy_VvPIBeWaL0a_YclJWb_V1gi3Yyw?e=...

Greg_Deckler
Super User
Super User

If you have confirmed your email address, you can post PBIX files I believe. Otherwise, share it out on OneDrive or Box. Or, just post sample data in text format that can be copied and supply your calculations, etc.

 

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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