Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

PQ how to duplicate column ?

Hi All

So that i can splite the below field for create brand field and still keep the org field.

 

  • Hi Anonymous 

    You can use the Text functions like Text.Start to create a new column from a sub-string of your Stock Description text.  Eactly what part of that description forms the brand?

    Phil

  • Hi Anonymous 

    The line you need is 

    #"Added Custom" = Table.AddColumn(#"Removed Columns", "Brand", each if Text.Length([Stock Description]) > 0 then Text.Start([Stock Description], Text.PositionOf([Stock Description], " ")) else "")

    I've added it to your PBIX file so download that from here.

    Regards

    Phil

  • Anonymous 

    you can also try to create a custom column. Just double click the column name in the list on the right side and click ok.

8 Replies

  • Hi Anonymous 

    You can use the Text functions like Text.Start to create a new column from a sub-string of your Stock Description text.  Eactly what part of that description forms the brand?

    Phil

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Phil

      thank you for your advise.

      I get the first word of the Description field to form the Brand.

      for example :- Desciption =Beckhoff BC9000 

      Brand = Bekhoff 

      Paul

       

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Icon for Super User rankSuper User

        Hi,

        If you want a calculated column solution in DAX, then try this

        Column = TRIM(LEFT(SALES[Stock Description],SEARCH(" ",SALES[Stock Description],1,BLANK())))

        Hope this helps.

  • Hi Anonymous 

    The line you need is 

    #"Added Custom" = Table.AddColumn(#"Removed Columns", "Brand", each if Text.Length([Stock Description]) > 0 then Text.Start([Stock Description], Text.PositionOf([Stock Description], " ")) else "")

    I've added it to your PBIX file so download that from here.

    Regards

    Phil

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Phil

      Thank you very much. May i know how you do it ?

      Pls share few screen shot.

      Paul

      • ryan_mayu's avatar
        ryan_mayu
        Icon for Super User rankSuper User

        Anonymous 

        you can also try to create a custom column. Just double click the column name in the list on the right side and click ok.