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,
Hi Ashish_Mathur, thank you but do you have another work around? The M query takes time to process big data.
I have a DAX calculated column alternative (not an M query alternative). Are you interested in that?
- Ashish_Mathur5 years agoSuper User
Hi,
Try this calculated column formula
=calculate(countrows(data),filter(data,data[OrderNumber]=earlier(data[OrderNumber])&&data[RunDate]<=earlier(data[RunDate])))
Hope this helps.
- hmenco5 years agoFrequent Visitor
Okay with DAX, if it will perform faster than the M query and as long as it meets the desired outcome as well! Many thanks!