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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
mlmagl14
Helper I
Helper I

Avg. Sale of a Weekday

How do I calculate the avg sale of a weekday? For example, I have sales data from Aug1- today and I want to be able to calculate all the sales of all the Mondays and then get the avg sales of a Monday. Same for each of the other days of the week. i tried to just enter the weekday on the table and then sales number on the values field and then change it from sum to avg but it gave me a weird number. I also tried to use this DAX but it didnt work either :AVERAGEX(SUMMARIZE('Calendar','Calendar'[Date],'Calendar'[Weekday],"sum",AVERAGE('Data)'[Total Amt)])),[sum])

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

Hi @mlmagl14 ,

 

Add a weekday column to sales table.

Also add a weekday column to calendar table and use it as slicer.

Then create a measure like below:

measure = calculate(average(table[sales]),filter(all(table),table[weekday] = selectedvalue(slicer[weekday])))

If I misunderstood  your meaning, please share some sample data and expected result.

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hi @mlmagl14 ,

 

Add a weekday column to sales table.

Also add a weekday column to calendar table and use it as slicer.

Then create a measure like below:

measure = calculate(average(table[sales]),filter(all(table),table[weekday] = selectedvalue(slicer[weekday])))

If I misunderstood  your meaning, please share some sample data and expected result.

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Ashish_Mathur
Super User
Super User

Hi,

To your visual, drag Weekday and write this measure

Average sales = average(Data[sales[)

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.