Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Hi all
I'm tring to remove duplicates from the column.
column presents numbers, - , and Taken.
I need to remove only number duplicates and needs to keep "-" and "Taken" as it is.
Sharing below the current data and expected data.
current data | expected data |
1 | 1 |
1 | 2 |
2 | 3 |
3 | 4 |
- | - |
4 | taken |
taken | taken |
taken | 5 |
5 | 6 |
3 | - |
6 | 7 |
- | |
7 |
Please suggest me how to approach.
Thanks in advance 🙂
@tamerj1 @amitchandak @Greg_Deckler @Arul @v-zhangti @PowerQuerryGuru @Ashish_Mathur @FreemanZ
You can do a Group By where you make sure "taken" and "-" are treated uniquely.
Here's a sample query you can paste into the Advanced Editor in a new blank query:
let
Source = Table.FromColumns({{"1", "1", "2", "3", "-", "4", "taken", "taken", "5", "3", "6", "-", "7"}}, {"current data"}),
#"Added Index" = Table.AddIndexColumn(Source, "Index", 1, 1, Int64.Type),
#"Added Custom" = Table.AddColumn(#"Added Index", "Custom", each if [current data] = "taken" or [current data] = "-" then [Index] else 0, Int64.Type),
#"Grouped Rows" = Table.Group(#"Added Custom", {"current data", "Custom"}, {}),
#"Removed Other Columns" = Table.SelectColumns(#"Grouped Rows",{"current data"})
in
#"Removed Other Columns"
This creates a unique index but then zeros it out for the numbers so that they aren't treated uniquely.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
69 | |
66 | |
50 | |
32 |
User | Count |
---|---|
116 | |
99 | |
75 | |
65 | |
40 |