Forum Discussion
Anonymous
3 years agoNot applicable
Show highest values for each category
Hi, let's say I have the following data: Category Team Value A 1 5 B 2 10 C 3 15 D 1 20 A 2 5 B 3 0 C 1 15 D 2 10 For each team I want to show the ...
pratyashasamal
Memorable Member
3 years agoHi Anonymous ,
Try this measure :-
MaxTest = MAXX(VALUES('DimensionTableName'[Category]),[NameOfMeasureWhichSumsTheValues])
Hope this was helpful.
Thanks,
Pratyasha Samal
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
Thanks,
Pratyasha Samal
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
- Anonymous3 years agoNot applicable
pratyashasamal Hi, thanks for your reply! This solution only looks at the maxium value of 'value'? Because I need the category where the SUM of value is the highest for each team.
- pratyashasamal3 years ago
Memorable Member
Hi Anonymous ,
You can use TOPN function to get the highest sum of sales value by category.
For example :-EVALUATETOPN (1,ADDCOLUMNS (VALUES ( 'Product'[Product Category] ),"@Sales Amount", [Sales Amount]),[@Sales Amount],DESC)ORDER BY [@Sales Amount] DESC
Example 2 :-TopN 2nd example = TOPN( 2, VALUES(DimProduct[Category]), CALCULATE(SUM(FactInternetSales[SalesAmount])) )
You can refer to this link :-
https://dax.guide/topn/Thanks,
Pratyasha SamalHas this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C - pratyashasamal3 years ago
Memorable Member
Anonymous , You can try this as well :-MaxTest = MAXX(VALUES('DimensionTableName'[Category]),MAX([Values]))
Thanks,
Pratyasha samal
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C- Anonymous3 years agoNot applicable
pratyashasamal If I use this one, I get for every category the highest value of sum. That is not what I want. I need for each team only 1 category, not all of them with the highest values. How can I do that?