Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

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.

 

PaisCiudadDiaArea recorridaRango dias-9Rango dias+9Maximo valor dentro del rango (Valor que quiero obtener)
PeruLima4468.56355368.56
PeruLima4824.24395768.56
PeruArequipa7454.3658354.3
PeruArequipa7838.53698754.3
PeruCusco18565.5417619465.54
PeruCusco18744.8417819665.54
PeruCusco19050.1218119974.02
PeruCusco19243.6318320174.02
PeruCusco19457.0618520374.02
PeruCusco19541.118620474.02
PeruCusco19655.8318720574.02
PeruCusco19974.0219020874.02
PeruCusco20169.519221074.02
PeruCusco20568.3419621474.02
PeruCusco20766.5219821674.02
PeruCusco22654.5821723554.58
PeruCusco22833.6421923754.58
PeruCusco23137.7222224054.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 _ kalyj

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

1 Reply

  • 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 _ kalyj

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.