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
ZunzunUOC
Resolver III
Resolver III

Conditional Sum/Acumulado por mes condicional

Hi everybody, I need help with a query / Saludos a tod@s. Necesito ayuda con una consulta.

 

I have the next data: / Parto de los siguientes datos (simplificado):

 

PBIQ001.png

 

PBIQ003.png

 

 

I need to sum every month the ID's values with end date is fewer than agreement date/ Lo que necesito es cálcular cada mes cuánto importe se ha adelantado por ID adelantado (fecha cierre<fecha compromiso) y que además lo calcule cada mes, es decir, si ponemos de ejemplo el ID '8' tendría que contar en el mes de abril, mayo y junio.

 

The result must be (Omitting third colunm): / De esta forma, el resultado debería ser algo como esto:

 

PBIQ002.png

 

 

Thanks / Gracias!

 

1 ACCEPTED SOLUTION
ZunzunUOC
Resolver III
Resolver III

 

Finally, I have created a new table and the next calculated column works:

 

Result = CALCULATE(SUM('Report Diario'[Amount]);FILTER('Report Diario';AND(Calendario[Date]<'Report Diario'[Agreement Date];AND(Calendario[Date]>'Report Diario'[End Date];NOT(ISBLANK('Report Diario'[End Date]))))))

View solution in original post

5 REPLIES 5
ZunzunUOC
Resolver III
Resolver III

 

Finally, I have created a new table and the next calculated column works:

 

Result = CALCULATE(SUM('Report Diario'[Amount]);FILTER('Report Diario';AND(Calendario[Date]<'Report Diario'[Agreement Date];AND(Calendario[Date]>'Report Diario'[End Date];NOT(ISBLANK('Report Diario'[End Date]))))))

ZunzunUOC
Resolver III
Resolver III

Hi again, I'm working on that.

 

MedidaAcumulado = CALCULATE(SUM('Report Diario'[Amount]);FILTER('Report Diario';'Report Diario'[End Date]<'Report Diario'[Agreement Date]))

 

That works, but just sum the amount in the month wich is equal at End Date.

v-chuncz-msft
Community Support
Community Support

@ZunzunUOC ,

 

You may check if the following post helps.

https://community.powerbi.com/t5/Developer/Dax-Help-Create-table-with-variable-of-lines-according-to...

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

Hi @v-chuncz-msft, thank so much for your reply.

 

Maybe, I didn't explain correctly.

 

If I have an ID with the next information:

Start Date: 01/01/19

Agreement date: 08/15/19

End Date: 30/04/2019

Amount: 100€

 

I need to sum the amount on May, June and July; due to the end date is fewer than agreement date.

 

Thanks for your help.

I have updated with the english language. Thanks.

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.