Forum Discussion
Using the maximum value in a matrix in a calculation
- Anonymous5 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.
In your visual, where is the customer name coming from?
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.