Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello all,
I encounter the error by showing not enough memory when using earlier funciton.
My purpose is to get accumulated qty based on same date and same sku. The example below:
Date_Created | Material | Quantity | Index | Accumulated_Qty |
25-Oct | A | 100 | 1 | 100 |
25-Oct | A | 200 | 2 | 300 |
25-Oct | A | 300 | 3 | 600 |
25-Oct | B | 400 | 4 | 400 |
25-Oct | B | 500 | 5 | 900 |
25-Oct | B | 600 | 6 | 1500 |
The DAX I used:
Accumulated_Qty =
I also tried to use var but still failed:
Qty_Accum =
VAR CurrentIndex = Basic_1[Index]
VAR CurrentMaterial = Basic_1[Material]
VAR CurrentDate = Basic_1[Date created]
RETURN
SUMX(
FILTER(
Basic_1,
Basic_1[Index] <= CurrentIndex &&
Basic_1[Material] = CurrentMaterial &&
Basic_1[Date created] = CurrentDate
),
Basic_1[Quantity]
)
Is there any other way to improve that? Thanks for help!
Solved! Go to Solution.
Hi @nbufff
Can try the window function, It may have better performance.
Accumulated_Qty =
SUMX(
WINDOW(1,ABS,0,REL,ORDERBY('Basic_1'[Index],ASC,'Basic_1'[Quantity]),PARTITIONBY(Basic_1[Date_Created],'Basic_1'[Material])),
'Basic_1'[Quantity]
)
Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !
Thank you~
Great solution. Thanks to let me know the Window fuction.
Hi @nbufff
Can try the window function, It may have better performance.
Accumulated_Qty =
SUMX(
WINDOW(1,ABS,0,REL,ORDERBY('Basic_1'[Index],ASC,'Basic_1'[Quantity]),PARTITIONBY(Basic_1[Date_Created],'Basic_1'[Material])),
'Basic_1'[Quantity]
)
Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !
Thank you~
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
20 | |
7 | |
6 | |
5 | |
5 |
User | Count |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |