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

Join 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.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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