Forum Discussion
Expand table after merge changes my data
Hello All.
Please help me with this. It's really strange. I want to get the previous row action date based on entity name and my index.
it was previously sorted Entity name asc, action date desc. Then I add a index. Then I add a substraction which is index - 1. Belowing is the screenshot.
Then I went to merger, and do as belowing. Everything still fine, the index and subtraction was still match with the action date.
Here, when I expand the table, I don't know what happened, the order changed so that's not the thing I want. Please help!
Thank you so much
- Anonymous3 years ago
Here is the solution I found. If you want get previous row value(in a certain sort) try this.
Refer to Previous Row for Subgroups in Power Query - YouTube
you would need to add the step after expanding.
As for the previous row, here is a good method of achieving that:
5 Replies
- StachuCommunity Champion
What kind of join are you using? Inner or left/right?
Even though the order is different the actual data should be the same, you can add step ordering in the original order again.
Also, please consider that once you load the table to DAX the order of the rows is completely irrelevant, so try to avoid implenting any logic that way (again, that's in DAX, M has different behaviour)
- AnonymousNot applicable
Hi Stachu,
Thanks for replying me. I was using Left join. I've tried to add step between merge and expand. However, it seems like not working. My goal is to calculate the duration of each step in that sequence. So, I came up with get previous row value then calculate the duration.
- StachuCommunity Champion
you would need to add the step after expanding.
As for the previous row, here is a good method of achieving that:
- AnonymousNot applicable
Here is the solution I found. If you want get previous row value(in a certain sort) try this.
Refer to Previous Row for Subgroups in Power Query - YouTube
- AnonymousNot applicable
Never try table.buffer trust me, that is the most stupid thing I ever found.