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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.