Forum Discussion
Help With Cumulative Total
- 2 years ago
Thank you for reaching back out, I found a resolution by doing a grouping and running total that way. I appreciate your time and efforts in trying to help me resolve this.
here is an example of the table: it is the QTYRunning I am trying to create
Hi JustAThought ,
Assume that there is the field [Index] exist in the table 'Append1' and order the data by the field [DateType] (from S,S/O to P/O). You can update the formula of your measure [QTYRunning] as below:
QTYRunning =
VAR CurrentDate =
MAX ( 'Append1'[Date] )
VAR CurrentIndex =
MAX ( 'Append1'[Index] )
VAR CurrentItemCode =
MAX ( 'Append1'[ItemCode] )
RETURN
CALCULATE (
SUM ( 'Append1'[QTY] ),
FILTER (
ALLSELECTED ( 'Append1' ),
'Append1'[ItemCode] = CurrentItemCode
&& 'Append1'[Date] <= CurrentDate
&& 'Append1'[Index] <= CurrentIndex
)
)
If the above one can't help you figure out, please provide some raw data in your table 'Append1' (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:
How to provide sample data in the Power BI Forum
And it is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards