Forum Discussion
RTERCERO
Helper I
3 years agoConditional Cummulative Sum
Hello, I'm looking to calculate how my inventory applies to may demand on process sequence so if I have over supply for an order change it for another PO. So I have my balance in another table ...
sturlaws
Resident Rockstar
3 years agoHi, RTERCERO,
could you share your pbix-file? Or, if that is not possible, create an example file reproducing your issue?
How to Get Your Question Answered Quickly
Cheers,
Sturla
RTERCERO
Helper I
3 years ago- sturlaws3 years ago
Resident Rockstar
Nice. I looked at it, but I don't understand what you are trying to do. Could you, based on the values in the file you provided, create a table in excel or something to show your desired outcome?
- RTERCERO3 years ago
Helper I
Hi sturlaws ,
Tables involved:
ANALISIS
Expected result on column "BALANCE PLANTA ACTUAL":
Attached file with formula made in Excel:
https://we.tl/t-LcrjvvbTeX
Best Regards
RT- Ashish_Mathur3 years ago
Super User
Hi,
These calculated column formulas work
calculated Column 1 = LOOKUPVALUE(ANALISIS[BAL. EXPORTAR],ANALISIS[SKU|CNC|COSTURA],CONSOLIDADO[SKU|CNC|COSTURA],ANALISIS[SKU|CNC],CONSOLIDADO[SKU|CNC])Calculated column 2 = if(CONSOLIDADO[Calculated Column 1]<=-CONSOLIDADO[DOCENAS],CONSOLIDADO[DOCENAS],0)calculated column 3 = CALCULATE(SUM(CONSOLIDADO[Calculated Column 2]),FILTER(CONSOLIDADO,CONSOLIDADO[SKU|CNC|COSTURA]=EARLIER(CONSOLIDADO[SKU|CNC|COSTURA])&&CONSOLIDADO[SECUENCIA]<EARLIER(CONSOLIDADO[SECUENCIA])))calculated column 4 = if((CONSOLIDADO[Calculated Column 1]+CONSOLIDADO[Calculated Column 3])<=-CONSOLIDADO[DOCENAS],CONSOLIDADO[DOCENAS],0)calculated column 5 = CALCULATE(SUM(CONSOLIDADO[Calculated Column 4]),FILTER(CONSOLIDADO,CONSOLIDADO[SKU|CNC|COSTURA]=EARLIER(CONSOLIDADO[SKU|CNC|COSTURA])&&CONSOLIDADO[SECUENCIA]<EARLIER(CONSOLIDADO[SECUENCIA])))calculated column6 = CONSOLIDADO[Calculated Column 1]+CONSOLIDADO[Calculated Column 5]The last column will give you your desired result