Forum Discussion
elamad2024
1 year agoNew Member
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
danextian
Super User
1 year agoHow did you come up with 2179577? The average of tue-wed is 2184097
elamad2024
1 year agoNew Member
sorry my bad. i meant tue-thu
- danextian1 year ago
Super User
try this:
tuethur = CALCULATE( AVERAGEX ( ADDCOLUMNS ( SUMMARIZE ( FILTER ( 'Fact', 'Fact'[Weekday] IN { "tue", "wed", "thu" } ), 'Fact'[Weekday] ), "@sales", CALCULATE ( SUM ( 'Fact'[sales] ) ) ), [@sales] ), ALLSELECTED() --apply average to all visible rows )