Forum Discussion
MAXX SUM value return category (Hour range)
I have a table with hour ranges and summed values:
| Hour Ranges | Values |
| 09.00 - 10.00 | 10 |
| 10.00 - 11.00 | 117 |
| 11.00 - 12.00 | 215 |
| 12.00 - 1.00 | 2040 |
| 1.00 - 2.00 | 1711 |
| 2.00 - 3.00 | 2323 |
| 3.00 - 4.00 | 4511 |
| 4.00 - 5.00 | 1109 |
I have used this measure to grab the MAXX value e.g. 4511
Hours Range - MAX =
MAXX(
CALCULATETABLE(
VALUES('Table'[Hours Range])
)
, CALCULATE(
SUM('Table'[Value])
)
)
Hi Anonymous ,
According to your description, I did the following test for your reference:
M = VAR a = MAX ( 'Table (2)'[Values] ) RETURN CALCULATE ( MAX ( 'Table (2)'[Hour Ranges] ), FILTER ( ALL ( 'Table (2)' ), 'Table (2)'[Values] >= a ) )
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- CNENFRNL
Community Champion
Measure = MAXX( TOPN( 1, 'Table', 'Table'[Values] ), 'Table'[Hour Ranges] ) - v-henryk-mstf
Community Support
Hi Anonymous ,
According to your description, I did the following test for your reference:
M = VAR a = MAX ( 'Table (2)'[Values] ) RETURN CALCULATE ( MAX ( 'Table (2)'[Hour Ranges] ), FILTER ( ALL ( 'Table (2)' ), 'Table (2)'[Values] >= a ) )
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.