Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello.
i'd like to know how efficient my code is at extracting "Maximum Packing ID" from another table ([Packing_Bom]).
here is my code:
let
ListOfPackingID = Table.ToColumns([Packing_BOM]){10},
MaxPackingID = List.Max(ListOfPackingID),
Result = Table.SelectRows([Packing_BOM],each [PackingID] = MaxPackingID)
in
Result
[Packing_Bom] is the right side of relation from which I want to retrive the related records. Although it works and yields required result, I care about the efficiency of it.
thank you
Solved! Go to Solution.
Hi, @HamidRezaSajad
ListOfPackingID = Table.ToColumns([Packing_BOM]){10},
It's a pretty clever way to get just the column you need, but it's kind of like taking a scenic route to get to your favorite coffee shop when there's a shortcut. While the view is nice, it's not always the quickest way to go.
But, you can directly access the PackingId column instead of converting the entire table to columns first.
you can try something like,
let
PackingIDs = Table.Column([Packing_BOM], "PackingID"),
MaxPackingID = List.Max(PackingIDs),
Result = Table.SelectRows([Packing_BOM], each [PackingID] = MaxPackingID)
in
Result
Proud to be a Super User!
Hi, @HamidRezaSajad
ListOfPackingID = Table.ToColumns([Packing_BOM]){10},
It's a pretty clever way to get just the column you need, but it's kind of like taking a scenic route to get to your favorite coffee shop when there's a shortcut. While the view is nice, it's not always the quickest way to go.
But, you can directly access the PackingId column instead of converting the entire table to columns first.
you can try something like,
let
PackingIDs = Table.Column([Packing_BOM], "PackingID"),
MaxPackingID = List.Max(PackingIDs),
Result = Table.SelectRows([Packing_BOM], each [PackingID] = MaxPackingID)
in
Result
Proud to be a Super User!
hello and thanks for your respons. yes you right. as you said, it could be much bettert off if i use Table.Column instead of Table.ToColumn.
there is always a bettwer way.
thank you
Happy to help
Proud to be a Super User!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 7 | |
| 4 | |
| 3 |