Forum Discussion
Neseren
1 year agoFrequent Visitor
Remove duplicates based on multiple criteria (2)
Hi I have some data that consists of duplicates. These duplicates needs to be removed on multiple criteria I have already used the "grouped by" function to specify the multiple criterias. Bu...
Anonymous
1 year agoNot applicable
Hi Neseren ,
you can use Number.Round to ensure that the values are within a manageable range before performing operations on them
= Table.Group(#"Changed Type", {"Batchnummer", "Nedre grænse", "Øvre grænse", "Target Value"}, {{"Resultat",
(x)=> [
t0 = List.Max(List.Transform(x[Nedre grænse], each Number.Round(Number.From(_), 2))),
t1 = List.Min(List.Transform(x[Resultat], each Number.Round(Number.From(_), 2))),
t2 = List.Max(List.Transform(x[Resultat], each Number.Round(Number.From(_), 2))),
t3 = List.Max(List.Transform(x[Øvre grænse], each Number.Round(Number.From(_), 2))),
Resultat = if t2 > t0 and t1 > t0 then t1 else if t2 < t0 and t1 < t0 then t2 else if t0 = t1 then t1 else if (List.Count({t1..t0}) + List.Count({t1..t0})) < (List.Count({t3..t2}) + List.Count({t3..t2})) then t1 else t2
][Resultat]}})
Hope it helps!
Best regards,
Community Support Team_ Scott Chang
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Neseren
1 year agoFrequent Visitor
Hi
I was wondering if that could be the sollution as well.
Unfortunately i still get the same error message on a handfull of cells: