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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
carlosmari
Frequent Visitor

Problema al acumular desde una medida

Hola a todos!!!!

Estoy queriendo acumular una medida y no me está funcionando. Más abajo presento la tabla. Allí la columna que no me funciona es la que llamo 'Acumulado Variación', esta columna lo que debiera hacer es ir acumulando por año lo que muestra la columna 'Variación Mensual' (0,00%+5,56%+0,00%+9,21%+ ....)

 

carlosmari_0-1634482457089.png

Tengo 3 medidas creadas:

1.  Indice = sum(Tabla[Indice])

2.  Variación Mensual =

        VAR IndiceMesAnterior =
               CALCULATE([Indice],DATEADD(Calendario[Fecha],-1,MONTH))
       RETURN
            DIVIDE(([Indice]-IndiceMesAnterior), IndiceMesAnterior)
3.  Acumulado Variación =
           CALCULATE([Variación Mensual],DATESYTD(Calendario[Fecha]))
 
En la medida 2 lo que hago es calcular la variación mensual que hubo con el campo 'Indice'. Esta medida da la información correcta.
El problema lo tengo en la medida 3. En este medida quiero ir acumulando por año lo que se muestra en la medida 2. Evidentemente la manera de acumular que estoy haciendo en la medida 3 no es correcta.
 
Gracias por la ayuda que puedan brindarme.
 
Carlos
1 ACCEPTED SOLUTION
v-robertq-msft
Community Support
Community Support

Hi, 

According to your description, I can roughly understand your requirement, I can’t open your download link but I created some sample test data according to your screenshots. I think you can achieve your requirement by creating a calculated column and changing the measure 3 like this, you can try my steps:

This is the test data I created:

vrobertqmsft_0-1635148919326.png

 

  1. Create an index column to sort it by the date column in your dataset:
Index = RANKX('Table',[Date],,ASC)
  1. Create the measure [Acumulado Variación] like this:
Acumulado Variación =

var _table=SUMMARIZE(ALL('Table'),[Mes],[Index],"1",[Variación Mensual])

return

SUMX(FILTER(_table,[Index]<=MAX('Table'[Index])),[1])

 

And you can get what you want, like this:

vrobertqmsft_1-1635148919345.png

 

You can download my test pbix file below

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

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

4 REPLIES 4
v-robertq-msft
Community Support
Community Support

Hi, 

According to your description, I can roughly understand your requirement, I can’t open your download link but I created some sample test data according to your screenshots. I think you can achieve your requirement by creating a calculated column and changing the measure 3 like this, you can try my steps:

This is the test data I created:

vrobertqmsft_0-1635148919326.png

 

  1. Create an index column to sort it by the date column in your dataset:
Index = RANKX('Table',[Date],,ASC)
  1. Create the measure [Acumulado Variación] like this:
Acumulado Variación =

var _table=SUMMARIZE(ALL('Table'),[Mes],[Index],"1",[Variación Mensual])

return

SUMX(FILTER(_table,[Index]<=MAX('Table'[Index])),[1])

 

And you can get what you want, like this:

vrobertqmsft_1-1635148919345.png

 

You can download my test pbix file below

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

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

Excelente!! Muchas gracias!!!! Dios te bendiga!

carlosmari
Frequent Visitor

El resultado de la medida 3 ('Acumulado Variación'), debiera darme este resultado:

carlosmari_0-1634487333044.png

Cada una de estos resultados es la suma acumulada por año de la medida 2 ('Variación mensual').

 

En este  Archivo Power Bi se puede descargar el proyecto que estoy usando.

 

Gracias por la ayuda.

 

Carlos

Aquí va nuevamente el archivo a descargar donde se presenta la situación antes planteada (daba un error en el anterior link, espero que ahora funcione):

 

file://CARLOS-MARI-UA/Users/Carlos%20Mar%ED/Google%20Drive/Prueba.pbix 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.