Forum Discussion
jazzyelsie
Dec 20, 2024Copper Contributor
Power Query Formula to Calculate Current Count From Previous Count per Name using Date
Hi everyone! I have a dataset with the following columns: Point Name, Pump Count, Record Date, and Index. My goal is to create a calculated column in Power Query that computes the following for eac...
ItsBhatti
Dec 20, 2024Iron Contributor
In Power Query, to calculate the current count from the previous count per name using the date, you can:
- Sort the Data: Sort by Name and Date in ascending order.
- Group by Name: Use the "Group By" option on the Name column.
- Add Index: Within each group, add an index column to create a sequence.
- Shift Count: Use a custom column to calculate the difference between the current and previous count by referencing the previous row using the index.
- Expand the Table: Combine the results back into one tablehttps://patrickraulin.de/
This method allows you to calculate differences or derive the current count based on the previous one for each name.