Forum Discussion

Raj3798's avatar
Raj3798
Frequent Visitor
2 years ago
Solved

Removing duplicates from column2 based on column 1

Hi , 

Attached the data below, I want to remove the duplicates and have the desired output. All my data is from the same  table.

Stack OrderReport No
11110
11111
11112
11113
21110
21111
21112
21113
31110
31111
31112
31113
41110
41111
41112
41113
51109
61109
71109
81109
91109
101107
111107
121107
131107
141106
141108
151105
161104
171103
181103
191103
201103
211106
211108




Desired Output after filters or dax being applied :

11110
21110
31110
41110

 

Thank you in advance.

  • Please try the following DAX: 

    SummaryTable = ADDCOLUMN(VALUES(Table[Stack Order]), "First Report No", CALCULATE(MIN(Table[Report No])))

    But the same result can also be acheived in PowerQuery, where you can go to Transform > Group By, and group by the Stack Order and Aggregate by the min Report Number

     

1 Reply

  • Please try the following DAX: 

    SummaryTable = ADDCOLUMN(VALUES(Table[Stack Order]), "First Report No", CALCULATE(MIN(Table[Report No])))

    But the same result can also be acheived in PowerQuery, where you can go to Transform > Group By, and group by the Stack Order and Aggregate by the min Report Number