Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Avg/day/store

Hi All,
I'm trying to calculate Avg/day/store but, my number are not coming out correctly. Is anything wrong with my DAX. 

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

     

    Please refer this measure:

    Measure =
    AVERAGEX ( ALLEXCEPT ( 'dim', 'dim'[store] ), [units sold] ) / 7
    

    If it doesn't work, please share some sample data.

     

    Best Regards,

    Jay

3 Replies

  • daXtreme's avatar
    daXtreme
    Icon for Solution Sage rankSolution Sage

    Hi Anonymous

     

    You've given too little context to answer this question. And the DAX is not correctly formatted, hence hard to read. No idea why you'd like to add Dim[Store] as a filter to CALCULATE. CALCULATE only takes tables as filters, not columns. But you could try this:

    Avg Per Day =
    averagex(
      values( 'Date'[calendar_date] ),
      [Units Sold] / 7 -- why divide by 7?
    )

    If you slice by Store, this should give you what you want in the current context. I also understand that [Units Sold] is a measure...

    • Anonymous's avatar
      Anonymous
      Not applicable

      daXtreme   I'm trying to calculcate Avg per day per store. Then Week Number on the column. 

      I'don't want the store slicer. it works with the store slicer.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Please refer this measure:

    Measure =
    AVERAGEX ( ALLEXCEPT ( 'dim', 'dim'[store] ), [units sold] ) / 7
    

    If it doesn't work, please share some sample data.

     

    Best Regards,

    Jay