Forum Discussion
total sales repeating per weekday
i have a table with total sales per weekday. i want to add a column to show average of tuesday and wednesday sales that repeats in every row
- Anonymous1 year ago
Thanks for the reply from Kedar_Pande , danextian and Ritaf1983 , please allow me to provide another insight:
Hi elamad2024 ,Here are the steps you can follow:
1. Create measure.
Measure = AVERAGEX( FILTER(ALL('Table'), WEEKDAY('Table'[Date],2)>=2&&WEEKDAY('Table'[Date],2)<=4),[sales])2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
9 Replies
- danextian
Super User
As always, please post a workable sample data (not an image), your expected result from the sample data and not any other data and the reasoning behind.
- elamad2024New Member
Weekday sales Tue-Wed mon 2 035 637 2 179 577 tue 2 162 885 2 179 577 wed 2 205 309 2 179 577 thu 2 170 536 2 179 577 fri 2 106 749 2 179 577 sat 1 172 431 2 179 577 sun 914 075 2 179 577 I want to create a measure that shows column Tue-Wed
- danextian
Super User
How did you come up with 2179577? The average of tue-wed is 2184097
- elamad2024New Member
sorry my bad. i meant tue-thu
- Ritaf1983
Super User
Hi elamad2024
If the logic isThen you can create a measure :
Tue_Wed_avg =CALCULATE(AVERAGEX(FILTER('Table', 'Table'[Weekday] in {"Tue","Wed"}),'Table'[Sales]), all('Table'[Weekday]))The pbix is attached.
If it is something else please give a formula of the needed logic.If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
- elamad2024New Member
thanks
i know that it should work, but it doesn't. i have tried everything. it is very strange
- Kedar_Pande
Super User
Tuesday_Wednesday_Avg =
CALCULATE(
AVERAGE('YourTable'[Sales]),
'YourTable'[Weekday] IN {"Tuesday", "Wednesday"}
)💌 If this helped, a Kudos 👍 or Solution mark ✅ would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn - AnonymousNot applicable
Thanks for the reply from Kedar_Pande , danextian and Ritaf1983 , please allow me to provide another insight:
Hi elamad2024 ,Here are the steps you can follow:
1. Create measure.
Measure = AVERAGEX( FILTER(ALL('Table'), WEEKDAY('Table'[Date],2)>=2&&WEEKDAY('Table'[Date],2)<=4),[sales])2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly