Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
fraggl
Regular Visitor

Take values from two comma separated lists to fill new columns

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:

CategoriesValues per category...<other data>...<even more data>
10,12,13,14,290,1,10,5,4  
10,11,12,13,19,14,15,17,18,230,0,30,40,0,30,40,80,50,25  

 

I have a second query that gives me the categories by id and name:

 

idName
10Category A
11Category B
12Category C
13Category D
14Category E
15Category 100
16Category 120
17Category F
19Category G
23Category H
29Category 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:

 

CategoriesValues per categoryCategory ACategory BCategory CCategory D... <other data><even more data>
10,12,13,14,290,1,0,5,40 110...   
10,11,12,13,19,14,15,17,18,230,0,30,40,0,30,40,80,50,25003040...   
          
          

 

Any help is highly appreciated.

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @fraggl ,

 

You can first get the following table by some steps.

vstephenmsft_1-1693471668968.png

Then use merge queries and pivot column to get the final result.

vstephenmsft_2-1693471744891.png

You can download my attachment for more details.

You can view the details in the applied steps.

vstephenmsft_3-1693471826307.png

 

 

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.           

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @fraggl ,

 

You can first get the following table by some steps.

vstephenmsft_1-1693471668968.png

Then use merge queries and pivot column to get the final result.

vstephenmsft_2-1693471744891.png

You can download my attachment for more details.

You can view the details in the applied steps.

vstephenmsft_3-1693471826307.png

 

 

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.           

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.