Forum Discussion

MattAdams's avatar
MattAdams
Helper I
8 years ago
Solved

Add data column from source database after query is initially created?

I havea  PBIX, and have created a query joined against two other tables. The majority of the columns in the query are straight columns from a data base source. I've learned I need to add another colu...
  • MattAdams's avatar
    MattAdams
    8 years ago

    I went into Advanced Editor after opening "edit queries". 

    1) Bolded is what I inserted into the top line:

    let
    Source = Sql.Database("dbserver", "db", [Query="SELECT #(lf) [SRV_RQST_B_NUMBER_DESC]#(lf),[SRV_RQST_B_STATE_DESC]#(lf),

     

    Then i inserted the below line into the columns where they're listed. Apparently #1 and #2 are required.

    2)

    SRV_RQST_B_STATE_DESC = Table.AddColumn(SRV_RQST_B_STATE_DESC),

     

     

    Then i clicked OK and it showed up in the table under the query.