Forum Discussion
Calculate month to month movement in power query
Question is bit abstract for the concrete suggestion.
I assume you have monthly totals for each client, not all transactions. Since all files are on Sharepoint folder I assume they all data from this files is collected and combine with Power Query in one table in resulting file which looks like
We would like to add M2M on client basis, not totals for all clients. To generate such transformation for one client
reference above query as new,
filter on one (any one) client,
sort by months,
add two Index columns one starts from 0 and another starts from 1.
merge table with itself on these two indexes
expand sales from resulting table (actually that will be ones for previous month)
add columns with different
remove unused columns
Preparing such query for one client transform it into the function with table as parameter. Group initial query by clients and apply above function as aggregation.
Result is like
My assumptions could be wrong, plus not clear how you would like to use results. Depends on this that could be another transformation and do you need to work with data model or not.