Forum Discussion
Cumulative Sum for individual material
- Anonymous3 years ago
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 ZhouIf 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.