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 have this particular table:
Variables | Values |
new person | 4 |
new person | 9 |
new person | 8 |
new person | 2 |
old person | 5 |
old person | 1 |
old person | 7 |
old person | 3 |
Now I want to convert the table in such a way that the final output should return this:
Variable | Value_1 | Variable | Value_2 |
new person | 4 | old person | 5 |
new person | 9 | old person | 1 |
new person | 8 | old person | 7 |
new person | 2 | old person | 3 |
So basically I want to split the variables and their associated values from one column to separate columns. Any tips / workarounds ?
Solved! Go to Solution.
=Table.FromColumns(List.Combine(Table.Group(PreviousStepName,"Variable",{"n",Table.ToColumns})[n]),List.TransformMany({0..List.Count(List.Distinct(PreviousStepName[Variable]))-1},each Table.ColumnNames(PreviousStepName),(x,y)=>if x=0 then y else y&"_"&Text.From(x)))
=Table.FromColumns(List.Combine(Table.Group(PreviousStepName,"Variable",{"n",Table.ToColumns})[n]),List.TransformMany({0..List.Count(List.Distinct(PreviousStepName[Variable]))-1},each Table.ColumnNames(PreviousStepName),(x,y)=>if x=0 then y else y&"_"&Text.From(x)))
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 |
---|---|
15 | |
11 | |
8 | |
8 | |
7 |
User | Count |
---|---|
15 | |
13 | |
9 | |
7 | |
6 |