Forum Discussion
Expanding column after left join shuffles values in single column
- 6 years ago
Hi Anonymous ,
I just got an ideia...
How about if you Group, Sort and add the index column (those 2 last inside the [Data] column instead of sort / group / index ?
Like:
#"Grouped Rows" = Table.Group(#"Sorted Rows", {"UnitOperationKey"}, {{"Data", each Table.AddIndexColumn(Table.Sort(_,{"StartTime"} ), "SequenceNr", 1,1), type table [UnitOperationKey=text, NoOfRepetitionsOfUO=number, StartTime=datetime, BatchID=text, Unit=text, Label=text, UnitOperation=text, SequenceNr=number]}})
Anonymous ,
Once it's a Power Query situation, please provide a file or import it as inputed values, so we can import it.
I know this post is almost two years old, but I wanted to report that I had the same issue.
If I filtered the data to get a smaller subset, I didn't have the issue of my original values getting mixed together (not just resorted, but mixed up), but with the full data set, it was a problem.
I resolved it by expanding and choosing to aggregate the field I wanted, and it worked. This definitely seems like a bug. I am using proprietary data so can't provide an example, but I wanted to report that this does appear to be a bug.
Is this on the development team's radar as a bug?
- steeveantoniche4 years agoRegular Visitor
Hey man, just went through the same problem and found this topic too. In another communities I found people explaining that when sorting with large number of rows this sorting cannot be reliable for the next steps to take place.
In this topic I found that a Table.buffer with the sorting operation solves this issue:
https://social.technet.microsoft.com/Forums/en-US/545daa09-56b5-486a-b851-02cff46ea372/expanding-merged-table-is-changing-values?forum=powerquery
This has solved my issues. I really hope Microsoft fixes this or at least have a warning or a documentation about sorting operation that explains it.