Forum Discussion
Remove duplicates - keep last vs keep first
- 9 years ago
In this scenario, if you want to keep the last records associated with each group column. You can build a calculated table aggregating values with max sort within each group.
I assume you a have a table like below:
Then you can create a calculated table like below:
Table = SUMMARIZE( Table3,Table3[Name], "Last Value", CALCULATE(SUM(Table3[Value]), FILTER(Table3,Table3[Sort]=MAX(Table3[Sort])) ) )
Regards,
Trying to figure out things.. What if there are other columns to be displayed? The M query worked as well.. But maybe i'll use it on the smaller data.
How can we display other columns that were hidden in the Partition?
Hi,
I shared an alternative DAX calculated solution yesterday. Try that one.
- hmenco5 years agoFrequent Visitor
I have tried both the M query and DAX calculated column.. Both solutions worked incredibly!
I will observe M query's performance on BIG data first.. If really not applicable, I'll use your DAX calculated column solution...
Thank you so much for taking time!!
- Ashish_Mathur5 years agoSuper User
Sure. Based on whichever works better on your live data, please mark that relevant response as Answer.