Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

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?

typelevel 2level 1
CategoryFoodFood
subcategoryFruitFood
Article number1Fruit
Article number2Fruit
Article number3Fruit
Article number4Fruit
Article nameapple1
Article nameorange2
Article namepear3
Article namebanana4

5 Replies

  • vanessafvg's avatar
    vanessafvg
    Community 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?

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi , i have lots of value it was example, that i want create parent column to my level 2 column

      • vanessafvg's avatar
        vanessafvg
        Community Champion

        what is the rule of creating that parent column?  in order to provide the right solution you need  to give more information.

  • Samarth_18's avatar
    Samarth_18
    Community 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

  • Anonymous's avatar
    Anonymous
    Not 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_Gao

     

    If 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