Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
gntorres
New Member

Calcular aumento en función de la inflación

Buenos días.

Les escribo para solicitar su ayuda. Les describo a continuación mi problema:

Tengo un índice de inflación y el costo de un material.

Con el indice de inflación calculo la inflación en el año, comparando el indice de un mes contra el indice del mismo mes del año anterior (para esto hice una medida rapida YoY).

Me interesaría calcular cual sería el costo del material si se hubiese ajustado por inflación. Es decir, tengo que generar una nueva serie que tome el valor en un periodo y lo  multiplique por (1+inflación), pero ese valor de inflación está asociado a una fecha un año despues.

 

A continuación les doy un ejemplo con dos periodos:

 

Mes | Precio | Indice inflación

1      | 100     |  250

2      | 115     | 275

 

En este ejemplo, el precio que estoy buscando calcular para el periodo 2 es 100*(275/250)=110. Si el precio del material se hubiese ajustado por inflación debería costar 110, no 115.

Desde ya les agradezco cualquier aporte.

 

Muchas gracias!

1 ACCEPTED SOLUTION
v-lionel-msft
Community Support
Community Support

Hi @gntorres ,

 

Please do like this.

1. Sort the [Year] and [Month] columns.

v-lionel-msft_0-1619417440832.png

2. Add an index column(In fact, the index column is a sorting column of year and month).

v-lionel-msft_1-1619417481151.png

3. Create a measure.

v-lionel-msft_2-1619417586411.png

Measure = 
VAR x = 
CALCULATE(
    MAX(Sheet8[Inflation index]),
    FILTER(
        ALL(Sheet8),
        [Index] = MAX([Index]) - 1
    )
)
VAR y = 
CALCULATE(
    MAX(Sheet8[Price]),
    FILTER(
        ALL(Sheet8),
        [Index] = MAX([Index]) - 1
    )
)
RETURN
DIVIDE(
    y * MAX([Inflation index]),
    x
)

 

Best regards,
Lionel Chen

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

 

View solution in original post

1 REPLY 1
v-lionel-msft
Community Support
Community Support

Hi @gntorres ,

 

Please do like this.

1. Sort the [Year] and [Month] columns.

v-lionel-msft_0-1619417440832.png

2. Add an index column(In fact, the index column is a sorting column of year and month).

v-lionel-msft_1-1619417481151.png

3. Create a measure.

v-lionel-msft_2-1619417586411.png

Measure = 
VAR x = 
CALCULATE(
    MAX(Sheet8[Inflation index]),
    FILTER(
        ALL(Sheet8),
        [Index] = MAX([Index]) - 1
    )
)
VAR y = 
CALCULATE(
    MAX(Sheet8[Price]),
    FILTER(
        ALL(Sheet8),
        [Index] = MAX([Index]) - 1
    )
)
RETURN
DIVIDE(
    y * MAX([Inflation index]),
    x
)

 

Best regards,
Lionel Chen

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

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.