Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I want to find out the Cumulative sum for individual materials. I have highlighted the desired result in yellow. Is this possible in DAX?
Solved! Go to Solution.
Hi @Neel98 ,
You can achieve this in Power BI. You need to add an [Index] or [Date] column to determine the order of the data.
Here I suggest you to add an Index by material group in Power Query Editor.
Sort your table as you want> Group all rows by Material column > Add index column by M query.
Table.AddIndexColumn([Count],"Index",1)
For reference:
Create Row Number for Each Group in Power BI using Power Query
Calculated column:
Cummulative Sum =
CALCULATE (
SUM ( 'Table'[Qty] ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[Material] ),
'Table'[Index] <= EARLIER ( 'Table'[Index] )
)
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Neel98 ,
You can achieve this in Power BI. You need to add an [Index] or [Date] column to determine the order of the data.
Here I suggest you to add an Index by material group in Power Query Editor.
Sort your table as you want> Group all rows by Material column > Add index column by M query.
Table.AddIndexColumn([Count],"Index",1)
For reference:
Create Row Number for Each Group in Power BI using Power Query
Calculated column:
Cummulative Sum =
CALCULATE (
SUM ( 'Table'[Qty] ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[Material] ),
'Table'[Index] <= EARLIER ( 'Table'[Index] )
)
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Neel98 just create measure like Total quantity = SUM(<YOUR TABLE NAME>[Qty]) and put it on table / matrix.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Proud to be a Super User!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
11 | |
11 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |