Forum Discussion
How to create columns dynamically based on other column ?
- 8 years ago
Hi Rahul66303,
Please check out the demo here. The solution depends on GUI operations. No code is needed.
Best Regards,
Dale
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 .
| Tag1 | Tag2 | Tag3 | Tag4 |
| Val1 | Val2 | Val1 | Val1 |
| Val2 | Val2 | Val1 | Val1 |
| Val1 | Val2 | Val1 | Val1 |
| Val3 | Val2 | Val1 | Val1 |
| Val1 | Val2 | Val1 | Val1 |
| Val2 | Val2 | Val1 | Val1 |
Appreciate it if some one can help asap.
Thanks,
Rahul
Hi Rahul66303,
Please check out the demo here. The solution depends on GUI operations. No code is needed.
Best Regards,
Dale