Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
I wanted a way to sort a records without converting to a table ; I came up with this ,
if anyone has better solution or improvement I would be interested.
let
rec = [ B = "abc", E = 12, D = "def", C = 10 , A = 5] ,
orderby = Record.FromList(
List.Repeat( {null} , Record.FieldCount( rec)),
List.Sort( Record.FieldNames( rec),Order.Ascending)
)
in orderby & recRichard
Solved! Go to Solution.
You can try this...
let
rec = [ B = "abc", E = 12, D = "def", C = 10 , A = 5],
sortFields = List.Sort(Record.FieldNames(rec)),
sortRecord = Record.ReorderFields(rec, sortFields, MissingField.Ignore)
in
sortRecord
Proud to be a Super User! | |
just to add, i did not know there was a re order , there are just so many m functions it's frightening.
You can try this...
let
rec = [ B = "abc", E = 12, D = "def", C = 10 , A = 5],
sortFields = List.Sort(Record.FieldNames(rec)),
sortRecord = Record.ReorderFields(rec, sortFields, MissingField.Ignore)
in
sortRecord
Proud to be a Super User! | |
just to add, i did not know there was a re order , there are just so many m functions it's frightening.
Thanks, had not thoiught of that.
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 11 | |
| 9 | |
| 6 | |
| 6 | |
| 6 |