Forum Discussion

elamad2024's avatar
elamad2024
New Member
1 year ago
Solved

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

  • Anonymous's avatar
    Anonymous
    1 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

  • 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.

  • WeekdaysalesTue-Wed
    mon2 035 6372 179 577
    tue2 162 8852 179 577
    wed2 205 3092 179 577
    thu2 170 5362 179 577
    fri2 106 7492 179 577
    sat1 172 4312 179 577
    sun914 0752 179 577

     

    I want to create a measure that shows column Tue-Wed

    • danextian's avatar
      danextian
      Icon for Super User rankSuper User

      How did you come up with 2179577? The average of tue-wed is 2184097

       

       

    • Ritaf1983's avatar
      Ritaf1983
      Icon for Super User rankSuper User

      Hi elamad2024 
      If the logic is 

      Then 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.

       

      • elamad2024's avatar
        elamad2024
        New Member

        thanks 

        i know that it should work, but it doesn't. i have tried everything. it is very strange

  • elamad2024 

    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

  • Anonymous's avatar
    Anonymous
    Not 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