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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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