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 August 31st. Request your voucher.
Hi guys,
I'm new at DAX, but I can't find any solution that fits for my problem.
Maybe one of you can help me.
I would like to calculate my future stock level based on the following table.
The last available stock is index 29. After that I would like to calculate the stock.
My idea is to calculate the stock level with the following formular: Stock[x]= (Stock[29] + SUM(DELTA[29:X]).
Could someone please help me with the DAX?
Hi @timo980111 , Please use the below,
Calculated column =
var index29stock = CALCULATE( MAX('table1'[BESTAND]), FILTER( 'table1'[Index]=29))
var futurestock = index29stock + 'table1'[delta]
RETURN
futurestock
Regards,
Nikhil Chenna
Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!
Unfortunately it's not working - Just to clarify I need the following formular as DAX:
Example for index31 -> stock31 = index29stock + Delta29 + Delta30 + Delta31.
Example for index32 -> stock32 = index29stock + Delta29 + Delta30 + Delta31.
Hi, @timo980111
Please try formula like:
Measure1 =
VAR stock29 =
CALCULATE ( [M_stock], FILTER ( Table1, Table1[Index] = 29 ) )
RETURN
SUMX (
FILTER (
ALL ( Table1 ),
Table1[Index] <= MAX ( Table1[Index] )
&& Table1[Index] >= 29
),
[M_DELTA]
) + stock29
Best Regards,
Community Support Team _ Eason
User | Count |
---|---|
27 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
31 | |
15 | |
12 | |
7 | |
6 |