Forum Discussion
Add Conditional Column (tag with 0 or 1)
- 1 year ago
1.) For future requests - allways provide sample data and expected resuld based on that!
2.) If you don't know how to do it - read note below my post.
3.) If you don't know how to use my query also read note below my post.
New sample: Removes duplicates in [Column1] and [Column2] and keep rows where there are no duplicates.
Before
After
let Source = Table.FromRows({{"A", 10, 1}, {"A", 10, 2}, {"B", 50, 5}, {"B", 50, 6}, {"C", 600, 8}, {"C", 600, 9}}), RemovedFirstDuplicate = Table.Combine(Table.Group(Source, {"Column1", "Column2"}, {{"T", each if Table.RowCount(_) = 1 then _ else Table.Skip(_), type table}})[T]) in RemovedFirstDuplicate
Centaur1, check this:
Before
After
let
Source = Table.FromRows({{"A", 10}, {"A", 20}, {"B", 50}, {"B", 60}, {"C", 500}, {"C", 600}}),
RemovedFirstDuplicate = Table.Combine(Table.Group(Source, {"Column1"}, {{"T", each Table.Skip(_), type table}})[T])
in
RemovedFirstDuplicateHi Dufoq3, I looked over the sample and I think it's not a duplicate because it needs to be on both the company name and the amount. I think the duplicate in the example is only on the company name, but I might not be understanding.
just to be clear, there are cases where there are not duplicates.
I would need some assistance on exactly where to place that code as well. I really don't know where it should be.
- dufoq31 year agoCommunity Champion
1.) For future requests - allways provide sample data and expected resuld based on that!
2.) If you don't know how to do it - read note below my post.
3.) If you don't know how to use my query also read note below my post.
New sample: Removes duplicates in [Column1] and [Column2] and keep rows where there are no duplicates.
Before
After
let Source = Table.FromRows({{"A", 10, 1}, {"A", 10, 2}, {"B", 50, 5}, {"B", 50, 6}, {"C", 600, 8}, {"C", 600, 9}}), RemovedFirstDuplicate = Table.Combine(Table.Group(Source, {"Column1", "Column2"}, {{"T", each if Table.RowCount(_) = 1 then _ else Table.Skip(_), type table}})[T]) in RemovedFirstDuplicate- Centaur11 year agoRegular Visitor
Hi, thank you for the revised. That is amazing.
I did click the link in the note however it is giving me this message:
- dufoq31 year agoCommunity Champion
Try it now - it should work:
- Centaur11 year agoRegular Visitor
thank you dufoq3. Very nice. I might need to ask a follow up but will ask another question since I am not sure what I need at the moment, if anything. I have to look over the data since I took a different path.
- dufoq31 year agoCommunity Champion
You're welcome.