Forum Discussion
create higher level colum
Hi, i have a table with two colums type and level 2, i need to create a new higher level colums level 1, i want my output as level 1 column, can this be done in power bi?
| type | level 2 | level 1 |
| Category | Food | Food |
| subcategory | Fruit | Food |
| Article number | 1 | Fruit |
| Article number | 2 | Fruit |
| Article number | 3 | Fruit |
| Article number | 4 | Fruit |
| Article name | apple | 1 |
| Article name | orange | 2 |
| Article name | pear | 3 |
| Article name | banana | 4 |
5 Replies
- vanessafvgCommunity Champion
Is this a dervied column? ie are you building it from a rule so if level 2 - apple then fruit?
its easy to do this in power query using the conditional column. If this is not what you mean can you give more details?
- AnonymousNot applicable
Hi , i have lots of value it was example, that i want create parent column to my level 2 column
- vanessafvgCommunity Champion
what is the rule of creating that parent column? in order to provide the right solution you need to give more information.
- Samarth_18Community Champion
HI Anonymous ,
Could please share the conditions on what basis level 1 column need to created? Can you please elaborate your question a bit.
Thanks,
Samarth
- AnonymousNot applicable
Hi Anonymous ,
First you need a table like this.
Then create a calculated column in the original table.
level 1 = LOOKUPVALUE(Table2[Higher Level],Table2[Current Level],'Table1'[level 2])Attach the PBIX file for reference. Hope it helps.
Best Regards,
Community Support Team_GaoIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data