Forum Discussion
PowerrrBrrr
Helper III
4 years agoGet the category with maximum value
I have below table and I am looking to get the category with Maximum value Table A Id Machines 1 MachineA ...
- 4 years ago
Hi,
MachineMaxPressure = VAR LatestDate = MAXX ( 'Table C', INT ( 'Table C'[Timestamp] ) ) VAR MaxPressureonLatestDate = CALCULATE ( MAXX ( 'Table C', IF ( INT ( 'Table C'[Timestamp] ) = LatestDate, IF ( RELATED ( 'Table B'[Description] ) = "Pressure rate", 'Table C'[Value] ) ) ) ) VAR TimeSeriesIDMaxPressureonLatestDate = LOOKUPVALUE ( 'Table C'[TimeseriesId], 'Table C'[Value], MaxPressureonLatestDate ) VAR IDMaxPressureonLatestDate = LOOKUPVALUE ( 'Table B'[ID], 'Table B'[timeseriesId], TimeSeriesIDMaxPressureonLatestDate ) VAR MachineMaxPressureonLatestDate = LOOKUPVALUE ( 'Table A'[Machines], 'Table A'[Id], IDMaxPressureonLatestDate ) RETURN MachineMaxPressureonLatestDateRegards
PowerrrBrrr
Helper III
4 years agoIts there with the solution Jose provided, in your case its "
_maxValue
" both give the same result and same error
v-xiaotang
Community Support
4 years agoHi PowerrrBrrr
Strangely. I am not able to repro the error you mention with the sample data you post.
Regards,
Community Support Team _Tang