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.
Hello community members,
I'm still a newbie with PowerQuery and PowerBI and learning a lot from your valuable solutions.
Maybe you can help me with the following:
In a PowerBI query I have the following situation in a table:
Categories | Values per category | ...<other data> | ...<even more data> |
10,12,13,14,29 | 0,1,10,5,4 | ||
10,11,12,13,19,14,15,17,18,23 | 0,0,30,40,0,30,40,80,50,25 |
I have a second query that gives me the categories by id and name:
id | Name |
10 | Category A |
11 | Category B |
12 | Category C |
13 | Category D |
14 | Category E |
15 | Category 100 |
16 | Category 120 |
17 | Category F |
19 | Category G |
23 | Category H |
29 | Category Z |
What I want:
In my first table, I want to "decode" the category ids from column "Categories" to single columns with the category names from my second query and to fill the values per category in the corresponding columns. I don't want to have lines per value with all other cloumns repeated per line, but the columns as shown in the example:
Categories | Values per category | Category A | Category B | Category C | Category D | ... | <other data> | <even more data> | |
10,12,13,14,29 | 0,1,0,5,4 | 0 | 1 | 10 | ... | ||||
10,11,12,13,19,14,15,17,18,23 | 0,0,30,40,0,30,40,80,50,25 | 0 | 0 | 30 | 40 | ... | |||
Any help is highly appreciated.
Solved! Go to Solution.
Hi @fraggl ,
You can first get the following table by some steps.
Then use merge queries and pivot column to get the final result.
You can download my attachment for more details.
You can view the details in the applied steps.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @fraggl ,
You can first get the following table by some steps.
Then use merge queries and pivot column to get the final result.
You can download my attachment for more details.
You can view the details in the applied steps.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 | |
12 | |
8 | |
8 | |
7 |
User | Count |
---|---|
15 | |
13 | |
9 | |
7 | |
6 |