locked
DAX: CALCULATE on SUMMARIZE with named column ? RRS feed

  • Question

  • hi all,

    I have a SUMMARIZE over a group of columns, with a *named column* for a particular calculation for a set of values, that works great.  I would like to further do a MAX on this entire SUMMARIZE table however I get an error that the named column inside of the SUMMARIZE is not able to be identified within the outer CALCULATE call.  I am missing something basic, I believe.

    For example, using AdventureWorks, how would I get the MAX of the "AvgOrder" below   (I know it does not make much sense, this is just a stripped down example for troubleshooting purposes).

    DEFINE 
    MEASURE 'Internet Sales'[DistinctDays] = distinctcount('Internet Sales'[Order Date])

    EVALUATE 
    SUMMARIZE('Internet Sales', 
     [Ship Date], "AvgOrder", SUM('Internet Sales'[Sales Amount])/[DistinctDays] )


    Any help is much appreciated .
    Cos


    • Edited by Cos2008 Tuesday, February 18, 2014 9:59 PM
    Tuesday, February 18, 2014 9:28 PM

Answers

  • for the benefit of others....pretty easy, thx to Alberto, wrap the SUMMARIZE within a MAXX function  :-)


     
    • Marked as answer by Cos2008 Wednesday, February 19, 2014 3:38 PM
    • Edited by Cos2008 Wednesday, February 19, 2014 6:28 PM
    Wednesday, February 19, 2014 3:37 PM

All replies

  • for the benefit of others....pretty easy, thx to Alberto, wrap the SUMMARIZE within a MAXX function  :-)


     
    • Marked as answer by Cos2008 Wednesday, February 19, 2014 3:38 PM
    • Edited by Cos2008 Wednesday, February 19, 2014 6:28 PM
    Wednesday, February 19, 2014 3:37 PM
  • Hi Cos2008,

    Glad to hear that you issue had been solved. Thank you for your sharing.

    Regards,


    Charlie Liao
    TechNet Community Support

    Thursday, February 20, 2014 1:29 AM