Forum Discussion
TM
Advocate I
10 years agoComparing Sales Orders (rows) and keeping the highest version number - two column filtering
Hi, I have got two columns, "Sales Orders" and "Version number". The sales have a correlating ID in this format: "M00123456". The data comes from an Access database. The version number is a whole...
- 10 years ago
Hi TM,
I can only agree with itchyeyeballs: Grouping in combination with a MAX function should solve your problem. I copied your table into Excel and then pulled it into Power Query. My script looks like this
let Source = Excel.CurrentWorkbook(){[Name="Tabelle1"]}[Content], #"Change Type" = Table.TransformColumnTypes(Source,{{"Sales Order ", type text}, {" Version number", Int64.Type}}), #"Group Rows" = Table.Group(#"Change Type", {"Sales Order "}, {{"HighestVersionNumber", each List.Max([#" Version number"]), type number}}) in #"Group Rows"The result is the following:
Hope that helps.
Regards,
Lars
itchyeyeballs
Impactful Individual
10 years agoI typed out a soultion for using the group by functionality (either in Access or power query) to create a lookup table, using the max function to only return the highest version number.
May be a way to go if TM doesn't wan't the other order data in his model at all I suppose.
konstantinos
Memorable Member
10 years agoitchyeyeballs you are right since if not using old data anywhere else, this can help navigating to data model and also performance, specially if the fact table contains millions of rows.