Forum Discussion
Anonymous
6 years agoNot applicable
How to find a group with highest value
Community,
I am a new learner in Power BI. I want to present a card to show a group with highest summarized value. For example, as the data showed below, the sum value of group A is 14, B is 12, C is 12. I want to present number and the group with highest sum value(which here is A 14) in a card. How can I achieve this?
| Name | Group | Value |
| aa | A | 2 |
| ab | A | 3 |
| ac | A | 4 |
| ad | A | 5 |
| af | B | 2 |
| dv | B | 1 |
| cc | B | 3 |
| cd | C | 4 |
| ee | C | 8 |
Thanks for the help
- Anonymous6 years ago
Anonymous
Go with this:
Measure = var TableA= SUMMARIZE('Table','Table'[Group],"Sumbygroup", SUM('Table'[Value])) Var Maxgroup = MAXX(FILTER(TableA,[Sumbygroup]=MAXX(TableA,[Sumbygroup])),[Group]) Var Maxsum = MAXX(FILTER(TableA,[Sumbygroup]=MAXX(TableA,[Sumbygroup])),[Sumbygroup]) Return CONCATENATE(Maxgroup,Maxsum)Paul Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- Greg_Deckler
Community Champion
Hello Anonymous
Try something like this:
Highest = VAR __Table = SUMMARIZE( 'Table', [Group], "__Value",SUM('Table'[Value]) ) VAR __Max = MAXX(__Table,[__Value]) RETURN MAXX(FILTER(__Table,[__Value] = __Max),[Group]) - AnonymousNot applicable
Anonymous
Go with this:
Measure = var TableA= SUMMARIZE('Table','Table'[Group],"Sumbygroup", SUM('Table'[Value])) Var Maxgroup = MAXX(FILTER(TableA,[Sumbygroup]=MAXX(TableA,[Sumbygroup])),[Group]) Var Maxsum = MAXX(FILTER(TableA,[Sumbygroup]=MAXX(TableA,[Sumbygroup])),[Sumbygroup]) Return CONCATENATE(Maxgroup,Maxsum)Paul Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.