Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. 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!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 9 | |
| 8 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 23 | |
| 14 | |
| 10 | |
| 6 | |
| 5 |