Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Using the maximum value in a matrix in a calculation

Hi Folks!  I have the following matrix:   Customer Value Acme 56 Gadget 78 Widget 34 Swag 79 Spacely 54 Duff 18   I want to use the largest value in the matrix to c...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hello jdbuchanan71 , I figured it out with the help of this article.

     

    The equations that solved everything were 

    Max SKU Count = MAXX(SUMMARIZE(ALLSELECTED('Table1').'Table1'[Customer Name],"MSKU",COUNT('Table1'[Pricelist SKU Count])),[MSKU])

    where Pricelist SKU Count = a calculated column

    Pricelist SKU Count = MAXX('Table1',[Pricelist SKU Count Temp])

    where Pricelist SKU Count Temp = a measure

    Pricelist SKU Count Temp = DISTINCTCOUNT('Table1'[Item Number])

     

    The mistake I kept making was in the top "Summarize" equation.  I started by using DISTINCTCOUNT and kept getting "1" returned as a value.  I changed it to COUNT and voila, problem solved!  I admit that there are likely bettre ways this can be done but I am happy with it as is.