Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
I am not an expert using this syntax and hoping I can tap the brain trust here to accomplish what I want quicker than tinkering with list.sort syntax on my own. Haven't been able to accomplish with sorting in previous pbi steps.
Using power bi, created a table and have grouped it to specifically extract a space separated list of (if your in healthcare) CPT codes.
It's specifically the order I'm looking to impact here. I've used the following logic to produce field called CPT_pattern and it produces what I want.. as far as the pattern. For example patterns returned are
90833 99214
90833 99213
However I want the field to list the 99214 or 99213 first: 99214 90833.
How do I override the default asc to accomplish what I need?
After a group by I added a custom field= Table.AddColumn(#"Grouped Rows", "CPT_pattern", each Table.Column([Data],"CPT"))
This is the step where I extract the values = Table.TransformColumns(#"Added Custom", {"CPT_pattern", each Text.Combine(List.Transform(_, Text.From), " "), type text})
Solved! Go to Solution.
Try this:
Table.TransformColumns(#"Added Custom", {"CPT_pattern", each Text.Combine(List.Transform(List.Sort(_, Order.Descending), Text.From), " "), type text})
--Nate
Try this:
Table.TransformColumns(#"Added Custom", {"CPT_pattern", each Text.Combine(List.Transform(List.Sort(_, Order.Descending), Text.From), " "), type text})
--Nate
Brilliant! I started reading about table.buffer and was hoping there was an easier solution. You provided it. Thank you.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
9 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
12 | |
11 | |
9 | |
6 | |
6 |