The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hello, everyone,
It is necessary for me to perform the inventory calculation using the attached data set, but I do not know how to implement the second recursive DAX formula that uses the previous calculated inventory value.
In advance, thank you very much for your support.
Product | Date | IN | OUT | Stock | DAX |
A | 28-ago-20 | 10000 | 2060 | 7940 | Stock = IN -OUT |
A | 29-ago-20 | 0 | 2830 | 5110 | Stock = (IN + Stock Yesterday) - OUT |
A | 30-ago-20 | 0 | 1920 | 3190 | |
A | 31-ago-20 | 10000 | 1920 | 11270 | |
A | 01-sep-20 | 0 | 1920 | 9350 | |
A | 02-sep-20 | 0 | 2490 | 6860 | |
A | 03-sep-20 | 20000 | 3288 | 23572 | |
A | 04-sep-20 | 0 | 3288 | 20284 | |
A | 05-sep-20 | 0 | 3288 | 16996 |
Solved! Go to Solution.
See a solution in the other thread you posted:
https://community.powerbi.com/t5/Desktop/Como-calcular-el-inventario/m-p/2714090#M948254
Proud to be a Super User!
Paul on Linkedin.
See a solution in the other thread you posted:
https://community.powerbi.com/t5/Desktop/Como-calcular-el-inventario/m-p/2714090#M948254
Proud to be a Super User!
Paul on Linkedin.
I really appreciate your valuable help, thank you very much.
Hi @Cipriano
If your date column has only unique values then you do
Stock =
VAR CurrentDate = TableName[Date]
VAR OnAndBeforeTable =
FILTER ( TableName, TableName[Date] <= CurrentDate )
RETURN
SUMX ( OnAndBeforeTable, TableName[IN] - TableName[OUT] )
I appreciate you, but it has different values.
User | Count |
---|---|
65 | |
62 | |
60 | |
53 | |
28 |
User | Count |
---|---|
181 | |
82 | |
67 | |
48 | |
44 |