Forum Discussion

kenzzzo82's avatar
kenzzzo82
Regular Visitor
9 years ago
Solved

Extracting the first comma separated value to a new column

This seems like it should be easy but I am having a bit of trouble. I have a list of clients each client has multiple servers. Each server for that client has the same specs and I have a separate spreadsheet with Specs on it. 

 

So to join the two together I just need one common server. 

 

The Webserver column lists the servers as "Server1,Server2,Server3"

 

I want to extract Server1 only for each client and populate a column called FirstServer. I can then join on that value to add in the specs for each client. Hope that makes sense :) 

  • In addition: if you want the result in a new column: choose Extract in the "Add Column" tab.

    In the Extract submenu, "Text Before Ddelimiter" should suit your needs,

5 Replies

  • Gui_Costa's avatar
    Gui_Costa
    Frequent Visitor

    Hey Buddy.

     

    You can use the "Extract" function, under the Transform tab in the query editor. This function allows you to choose the separator, in your case, the comma. 

    Hope it helps

     

    Regards

    • MarcelBeug's avatar
      MarcelBeug
      Icon for Community Champion rankCommunity Champion

      In addition: if you want the result in a new column: choose Extract in the "Add Column" tab.

      In the Extract submenu, "Text Before Ddelimiter" should suit your needs,

    • kenzzzo82's avatar
      kenzzzo82
      Regular Visitor

      I am new to using PowerBI Desktop and I only see Home and Modeling tabs. Do I need to add tabs in options some where?

      • MarcelBeug's avatar
        MarcelBeug
        Icon for Community Champion rankCommunity Champion

        No, you can choose "Edit Queries" on the Home tab.

         

        Then you will see the tabs and options we mentioned previously.