Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

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. 

awawaw_0-1666013188036.png

Then I went to merger, and do as belowing. Everything still fine, the index and subtraction was still match with the action date. 

awawaw_1-1666013245043.png

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!

awawaw_2-1666013451753.png

Thank you so much 

2 ACCEPTED SOLUTIONS
Anonymous
Not 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

View solution in original post

Stachu
Community Champion
Community Champion

you would need to add the step after expanding.

As for the previous row, here is a good method of achieving that:

https://www.thebiccountant.com/2018/07/12/fast-and-easy-way-to-reference-previous-or-next-rows-in-po...

 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

5 REPLIES 5
Anonymous
Not 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

Anonymous
Not applicable

Never try table.buffer trust me, that is the most stupid thing I ever found.

Stachu
Community Champion
Community 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)



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Anonymous
Not 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.  

 

Stachu
Community Champion
Community Champion

you would need to add the step after expanding.

As for the previous row, here is a good method of achieving that:

https://www.thebiccountant.com/2018/07/12/fast-and-easy-way-to-reference-previous-or-next-rows-in-po...

 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.