def add_percentile(df, fig):
    """Adds percebtile lines to an existing graphic based on the dataframe

    Parameters
    ----------
        df (Dataframe): Dataframe with the data to generate the percentiles
        fig (Figure): original figure

    Returns
    -------
        fig: figure with the trendline included
    """
    percentile = df.quantile([0.5, 0.85, 0.95])

    for key in percentile.keys():
        position = percentile[key]
        label = f"{int(key*100)}%"

        fig = fig.add_shape(
            type="line",
            yref="paper",
            x0=position,
            y0=0,
            x1=position,
            y1=0.95,
            line_dash="dash",
        )

        fig = fig.add_annotation(
            x=position, yref="paper", y=1, showarrow=False, text=label
        )
    return fig