Forum Discussion
kirbynguyen
Helper II
5 years agoMax of Aggregation
Hello, I am trying to find the max of aggregated data and I've been having trouble. Here is a sample input: Date Name Category Value 1/1/2021 A Bag 5 1/2/2021 A Ba...
- 5 years ago
Hey kirbynguyen ,
I assume this measure creates what you are looking for:
Measure = var __t = ADDCOLUMNS( CALCULATETABLE( SUMMARIZE( 'Table' , 'Table'[Name ] , 'Table'[Category ] ) , ALL( 'Table'[Category ] ) ) , "val" , CALCULATE( SUM( 'Table'[Value] ) ) ) return GROUPBY( __t , "v" , MAXX( CURRENTGROUP() , [val] ) )At least it allows to create a table visual that shows the desired output:
Hopefully, this is what you are looking for.
Regards,
Tom
TomMartens
Super User
5 years agoHey kirbynguyen ,
I assume this measure creates what you are looking for:
Measure =
var __t =
ADDCOLUMNS(
CALCULATETABLE(
SUMMARIZE(
'Table'
, 'Table'[Name ]
, 'Table'[Category ]
)
, ALL( 'Table'[Category ] )
)
, "val" , CALCULATE( SUM( 'Table'[Value] ) )
)
return
GROUPBY(
__t
, "v" , MAXX( CURRENTGROUP() , [val] )
)
At least it allows to create a table visual that shows the desired output:
Hopefully, this is what you are looking for.
Regards,
Tom