Forum Discussion
Remove duplicates in a DirectQuery and leave the entries with certain value in a column
- 6 years ago
Drag measure below to Visual level filters and set Show items when the value is 1.
Measure = IF ( CALCULATE ( DISTINCTCOUNT ( Table1[Status] ), ALLSELECTED ( Table1[Status] ) ) = 1 || MAX ( Table1[Status] ) = "accepted", 1 )
If you just want the accepted ones you can just filter the column of the status for the value accepted, however if you want to keep all other rows also the best option is to do a group by using your columns as grouping values and on the summarization for status select minimum value since accepted is before signed up.
- Achartuni6 years ago
Helper I
Hello MFelix,
Thank you for taking your time to comment on my thread.
Keeping the entries is a must that are not duplicated is a most, after all, the goal is to remove the duplicates leaving only those who are not duplicated and only one entry for those with the status as "accepted".
In regards to your solution, I tried it in the Query Editor and the result was not the right for us, that means, it ended up removing all the other columns (there's more than just id and status, I just summarized the table to simplify the question). Is there a workaround to this or are we applying your solution the wrong way?
- MFelix6 years ago
Super User
Hi Achartuni ,
Im assuming that you made the group by option correct?
In this case you need to place all the columns you need to choose advance, that will allow you to add more columns to your group by and also aggregations.
You need to select all columns that have similar values to the Groupings and all columns that have different values were you want to keep only the last one in the Aggregation.