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
Ely
New Member

Como calcular un acumulado del año cuando se tienen varias categorias

hola bue dia: 

 

estoy intentando calcular el acumulado del año para las ventas pero tengo diferentes categorias y quiero que el acumulado sea independiente: 

 

ejemplo: 

 

Mes   Producto  Ventas    YTD

ENE   ROJO         100        100

ENE    VERDE        50          50

FEB     ROJO          70        170

FEB     VERDE         40         90

MAR   ROJO         100       270

MAR   VERDE         50       140

 

 

y asi sucesivamente.... agradezco muchos sus comentarios 

saludos 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Please mark it as solution so it can help other people

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

You could just convert your months to a real date and then use DAX Time Intelligence Functions, they will do all the job:

Tabla1.PNG

YTD = TOTALYTD(SUM(Tabla1[Ventas]); Tabla1[Fecha])

 

v-danhe-msft
Employee
Employee

Hi @Ely,

Based on my test, you could refer to below steps:

Add index column in query editor:

1.PNG

Create a calculated column and now you could see the result.

Column = CALCULATE(SUM(Table2[Ventas]),FILTER('Table2','Table2'[Index]<=EARLIER(Table2[Index])&&'Table2'[Producto]=EARLIER(Table2[Producto])))

Result:

1.PNG

You could download the pbix file to have a view.

https://www.dropbox.com/s/ihmtfk0rqgsbl5w/Como%20calcular%20un%20acumulado%20del%20a%C3%B1o%20cuando...

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks a lot for you help, the formula worked correctly....

Anonymous
Not applicable

Please mark it as solution so it can help other people

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.