tips needed
2 Topicsget max value of most popular product aligned to various stores
I have managed to obtain a list of the most popular products (the ones listed the most) per store using the following code, now i need to add another measure which gives me the count for each of these products i want something like store Product count A bread 6 B soda 12 I have used the following dax code to get me where i am at the moment product mentioned most: = VAR _t = ADDCOLUMNS ( SUMMARIZE ( data, store[store], 'product'[product] ), "@count", CALCULATE ( COUNTROWS ( data ) ) ) VAR _index = SUMMARIZE ( INDEX ( 1, _t, ORDERBY ( [@count], DESC ),, PARTITIONBY ( store[store] ) ), store[store], 'product'[product] ) VAR _list = SUMMARIZE ( CALCULATETABLE ( data, TREATAS ( _index, store[store], 'product'[product] ) ), store[store], 'product'[product] ) RETURN CONCATENATEX ( _list, 'product'[product], ", " )Solved753Views0likes7CommentsHow To retrieve MAX / MIN using a measure on aggregated level(s)
Hello there I am actually working with Callcenter-Data. I need help to create measures returning ... the name of the CC-Agent with the Max Number of Calls per week ... the name of the CC-Agent with the Min Number of Calls per week Each should be displayed on a Card Visual One problem is that I do not find a way to calculate the max with a direct use of a metric figure (I countrows(facts) which represents the incoming phone number), but MAX() requires a table, not an aggregate. My Measure does not work MaxCallPerAgent = VAR vTbl = ADDCOLUMNS( dimAgents, "@Calls", [#Calls] ) VAR vMax_v1 = MAX( dimAgents[@Calls] ) -- does not work, no field [@Calls in table] VAR vMax_v2 = MAX( vTbl[@Calls] ) -- does not work, vTbl not allowed VAR Max_Topn = TOPN(1, vTbl, [@Calls], DESC ) -- gives no scalar value RETURN ??? I have tried some approaches but unfortunately I do not succeed callcenter.pbix The link leads to a pbix on my OneDrive with a reduced datamodel. Your help is appreciated. Thx & brgds ThomasSolved766Views0likes2Comments