Forum Discussion

Paul_Cracknell's avatar
Paul_Cracknell
Copper Contributor
Jun 03, 2022

Average Quantity Shipped by Day of Week

Hi, all. I am having a difficult time figuring out how to correctly formulate DAX so I get average quantity shipped per day of week.

 

I am using AVERAGEX(fShipments, [Total Qty]) but I am generating a number that isn't logical.  We ship about 100,000 units per week so my per day should be around 17,000. See attached screen shots.

1 Reply

  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Platinum Contributor

    Paul_Cracknell 

    Let's say you have one day of sales with a total quantity of 17000, with 100 transactions that day. Your measure takes 17000 / 100 = 170. What you want is the Total Qty of 17000 divided by the number of days 1 = 17000.

     

    The measure, thus, should be something like:

    =SUM([Qty])/DISTINCTCOUNT([Date])

     

    Now, DAX is a bit outside my comfort zone, so there may be a better way to do this.

     

     

Resources