cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rahul66303 Frequent Visitor
Frequent Visitor

How to create columns dynamically based on other column ?

Hi,

 

I need help on creating columns based on the column's values as below, I have column Tags in Table1 and values are delimeter based (Tag (This need to be column) : Val (This shoud be value).

 

Table1 :

Tags
Tag1:Val1;Tag2:Val2;Tag3:Val1;Tag4:Val1
Tag1:Val2;Tag2:Val2;Tag3:Val1;Tag4:Val1
Tag1:Val1;Tag2:Val2;Tag3:Val1;Tag4:Val1
Tag1:Val3;Tag2:Val2;Tag3:Val1;Tag4:Val1
Tag1:Val1;Tag2:Val2;Tag3:Val1;Tag4:Val1
Tag1:Val2;Tag2:Val2;Tag3:Val1;Tag4:Val1

 

This need to be transform as :

 

Tag1Tag2Tag3Tag4
Val1Val2Val1Val1
Val2Val2Val1Val1
Val1Val2Val1Val1
Val3Val2Val1Val1
Val1Val2Val1Val1
Val2Val2Val1Val1

 

i am able to spilt values from Tags column but not able to dynamically renamed the column 

 

Thanks,

Rahul

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
v-jiascu-msft Super Contributor
Super Contributor

Re: How to add columns dynamically to table based on text from another column.

Hi @Rahul66303,

 

Please check out the demo here. The solution depends on GUI operations. No code is needed.

How_to_add_columns_dynamically_to_table_based_on_text_from_another_column

 

Best Regards,

Dale

Community Support Team _ Dale
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

2 REPLIES 2
Rahul66303 Frequent Visitor
Frequent Visitor

How to add columns dynamically to table based on text from another column.

Hi,

 

Need to understand if below scenario is possible in Power BI desktop.

 

I have a table where one of the column (Tags) have delimiter based values as below, what i need to do is dynamically it should add 4 columns Tag1 as column1 and Val1,Val2,Val3 ... as values for Tag1 and similar structure for Tag2, Tag3 and Tag4.

Basically Tags contain ; delimeter for Tag and inside tag : delimeter should be used for column name and values.

 

Tags
Tag1:Val1;Tag2:Val2;Tag3:Val1;Tag4:Val1
Tag1:Val2;Tag2:Val2;Tag3:Val1;Tag4:Val1
Tag1:Val1;Tag2:Val2;Tag3:Val1;Tag4:Val1
Tag1:Val3;Tag2:Val2;Tag3:Val1;Tag4:Val1
Tag1:Val1;Tag2:Val2;Tag3:Val1;Tag4:Val1
Tag1:Val2;Tag2:Val2;Tag3:Val1;Tag4:Val1

 

Dynamically it should transform as per below, i know we can rename the column but i want it should give me dynamic name based on input in above Tags column .

 

Tag1Tag2Tag3Tag4
Val1Val2Val1Val1
Val2Val2Val1Val1
Val1Val2Val1Val1
Val3Val2Val1Val1
Val1Val2Val1Val1
Val2Val2Val1Val1

 

Appreciate it if some one can help asap.

 

Thanks,

Rahul

Highlighted
v-jiascu-msft Super Contributor
Super Contributor

Re: How to add columns dynamically to table based on text from another column.

Hi @Rahul66303,

 

Please check out the demo here. The solution depends on GUI operations. No code is needed.

How_to_add_columns_dynamically_to_table_based_on_text_from_another_column

 

Best Regards,

Dale

Community Support Team _ Dale
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

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 231 members 2,531 guests
Please welcome our newest community members: