Forum Discussion
Maximos por Rangos
Hola, tengo esta tabla . Donde tengo que traer el valor maximo dentro del rango de dias. Es decir, por ejemplo el día 44, mi rango de días a evaluar sería desde 35 hasta 53, entonces dentro de esa rango traer el maximo valor, y asi sucesivamente para cada día. Intente haciendo SUMMARIZE y algunos FILTERS, pero no me funcionan.
| Pais | Ciudad | Dia | Area recorrida | Rango dias-9 | Rango dias+9 | Maximo valor dentro del rango (Valor que quiero obtener) |
| Peru | Lima | 44 | 68.56 | 35 | 53 | 68.56 |
| Peru | Lima | 48 | 24.24 | 39 | 57 | 68.56 |
| Peru | Arequipa | 74 | 54.3 | 65 | 83 | 54.3 |
| Peru | Arequipa | 78 | 38.53 | 69 | 87 | 54.3 |
| Peru | Cusco | 185 | 65.54 | 176 | 194 | 65.54 |
| Peru | Cusco | 187 | 44.84 | 178 | 196 | 65.54 |
| Peru | Cusco | 190 | 50.12 | 181 | 199 | 74.02 |
| Peru | Cusco | 192 | 43.63 | 183 | 201 | 74.02 |
| Peru | Cusco | 194 | 57.06 | 185 | 203 | 74.02 |
| Peru | Cusco | 195 | 41.1 | 186 | 204 | 74.02 |
| Peru | Cusco | 196 | 55.83 | 187 | 205 | 74.02 |
| Peru | Cusco | 199 | 74.02 | 190 | 208 | 74.02 |
| Peru | Cusco | 201 | 69.5 | 192 | 210 | 74.02 |
| Peru | Cusco | 205 | 68.34 | 196 | 214 | 74.02 |
| Peru | Cusco | 207 | 66.52 | 198 | 216 | 74.02 |
| Peru | Cusco | 226 | 54.58 | 217 | 235 | 54.58 |
| Peru | Cusco | 228 | 33.64 | 219 | 237 | 54.58 |
| Peru | Cusco | 231 | 37.72 | 222 | 240 | 54.58 |
Hi Anonymous ,
According to your description, here's my solution.
Create a measure.
Measure = VAR _min = MAX ( 'Table'[Dia] ) - 9 VAR _max = MAX ( 'Table'[Dia] ) + 9 RETURN MAXX ( FILTER ( ALL ( 'Table' ), 'Table'[Dia] >= _min && 'Table'[Dia] <= _max ), 'Table'[Area recorrida] )Get the expected result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 Reply
- v-yanjiang-msftCommunity Support
Hi Anonymous ,
According to your description, here's my solution.
Create a measure.
Measure = VAR _min = MAX ( 'Table'[Dia] ) - 9 VAR _max = MAX ( 'Table'[Dia] ) + 9 RETURN MAXX ( FILTER ( ALL ( 'Table' ), 'Table'[Dia] >= _min && 'Table'[Dia] <= _max ), 'Table'[Area recorrida] )Get the expected result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.