- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

How to remove duplicates for each row and then shift columns to right in Power Query
Hi there,
Need help here, how can I convert below in Power Query? need to remove the duplicates in the right columns, then shift the columns without duplicates from left to right for each row
Thanks in advance!
Cheers
Walter
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @Walter_W2022 ,
Here you can open the advanced editor:
To the left of the "=" sign are the names of the individual steps; if they contain special characters (e.g. spaces), they must be nested outside #"".
Our previous step name was #"change type", so here we replace PreviousStepName with #"change type" and you can replace this step name as required.
Finally we need to return the result of the Custom1 step, so the result after in needs to be changed to Custom1.
Result.
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

NewStep=#table(Table.ColumnNames(PreviousStepName),Table.ToList(PreviousStepName,each let a=List.Count(_) in List.LastN(List.Repeat({null},a)&List.Distinct(_),a)))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Thank you for your reply, sorry, I could not make it work, would you please explain a bit more? as I am not familiar with M code. especially what does #table mean? how should I replace it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @Walter_W2022 ,
Here you can open the advanced editor:
To the left of the "=" sign are the names of the individual steps; if they contain special characters (e.g. spaces), they must be nested outside #"".
Our previous step name was #"change type", so here we replace PreviousStepName with #"change type" and you can replace this step name as required.
Finally we need to return the result of the Custom1 step, so the result after in needs to be changed to Custom1.
Result.
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

Subject | Author | Posted | |
---|---|---|---|
09-19-2023 08:01 AM | |||
10-09-2023 09:42 PM | |||
04-02-2022 08:39 PM | |||
05-31-2023 07:31 PM | |||
02-29-2024 04:42 AM |
User | Count |
---|---|
28 | |
27 | |
25 | |
14 | |
10 |
User | Count |
---|---|
24 | |
21 | |
17 | |
16 | |
10 |