Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Why Custom Columns are missing from Edit Query view?

I'm created new column in data view with Modelling->New Column.

However when I click "Edit Query" I don't see new column created.

 

This is issue for me, because I would like to do Append in Edit Query view. New column created are now missing from appended table.

 

 

  • Hi Anonymous ,

     

    Currently, the calculated column or calculated table which is created using DAX function won't be displayed in Query Editor.

     

    If you need to use a new column in Query Editor, you may go to Add column->Custom column, add a new custom column in Query Editor, see the similar case1 and case2. Then you may use Append feature to combine tables.

     

    If you would like to create column using DAX and need to combine tables into one like Append feature do, you can use function RELATED ,LOOKUPVALUE or FIRSTNONBLANK to get new calculated column, then use UNION function to get combined table.

     

    For example:

     

     

    Column1=RELATED([one side field of relationship])
    
    Column1= LOOKUPVALUE(tableA[goal field],  tableA[linked field],  tableB[linked field]))
    
    Column1= CALCULATE (FIRSTNONBLANK ( tableA[goal field], 1 ),FILTER ( ALL ( tableA), tableA[linked field] = tableB[linked field] ))
     
    
    New Table1= UNION(
    SELECTCOLUMNS('Table1',"Name1",[Description],"Name2",[Amount]),
    SELECTCOLUMNS('Table2',"Name1",[Description],"Name2",[Amount]),
    SELECTCOLUMNS('Table3',"Name1",[Description],"Name2",[Amount]))
     
    New Table1= UNION(Table1,Table2,Table3)

     

     

    Best Regards,

    Amy

     

    Community Support Team _ Amy

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

8 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Is it only option to create column with Power Query if I want to use the column in Append?

      • MartynRamsden's avatar
        MartynRamsden
        Icon for Solution Sage rankSolution Sage

        Anonymous 

         

        Yes, the column must exisit in Power Query to be used with Append.

         

        If it's not possible to create the column in Power Query, the you could create it in DAX and then create a calculated table using the UNION function to combine the 2 tables.

         

        Best regards,

        Martyn

         

        If I answered your question, please help others by accepting it as a solution.

  • Anonymous's avatar
    Anonymous
    Not applicable

     

    • Select any cell within your data range.

    • Go to Query Tools > Query > Edit Query.

    • In the Query Editor pane select Add Column > Column From Examples > choose From All Columns, or From Selection. For this example, we'll use the From all columns option.

       

      The Query Editor will open the Add Columns From Examples pane with a new, blank column on the right.

       
    • Enter a sample value for the new column data you want, then press Ctrl+Enter. In this case, we typed Montgomery, AL to join each capital with its respective state. Power Query will complete the rest of the column for you.

       

      If you need to make any edits to the new column, you can double-click any text field and edit it, then press Ctrl+Enter when you're done. Power Query will display the transformation steps above the data.

       
    • When you're done, press OK to confirm your actions, and Power Query will complete the transformation, returning to the Power Query Editor. You'll see the step added to the Applied Steps section in the Editor.

    I hope this information helps!
    Regards,

    Lewis

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Let say that I have DAX based Custom Column named "MachineId". My problem is that I don't see it in "Edit Query" View. I would need to Append  the table next with other table.

       

      Where I can add? I cannot find any selection.

       

       

       

       

       

  • v-xicai's avatar
    v-xicai
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

     

    Currently, the calculated column or calculated table which is created using DAX function won't be displayed in Query Editor.

     

    If you need to use a new column in Query Editor, you may go to Add column->Custom column, add a new custom column in Query Editor, see the similar case1 and case2. Then you may use Append feature to combine tables.

     

    If you would like to create column using DAX and need to combine tables into one like Append feature do, you can use function RELATED ,LOOKUPVALUE or FIRSTNONBLANK to get new calculated column, then use UNION function to get combined table.

     

    For example:

     

     

    Column1=RELATED([one side field of relationship])
    
    Column1= LOOKUPVALUE(tableA[goal field],  tableA[linked field],  tableB[linked field]))
    
    Column1= CALCULATE (FIRSTNONBLANK ( tableA[goal field], 1 ),FILTER ( ALL ( tableA), tableA[linked field] = tableB[linked field] ))
     
    
    New Table1= UNION(
    SELECTCOLUMNS('Table1',"Name1",[Description],"Name2",[Amount]),
    SELECTCOLUMNS('Table2',"Name1",[Description],"Name2",[Amount]),
    SELECTCOLUMNS('Table3',"Name1",[Description],"Name2",[Amount]))
     
    New Table1= UNION(Table1,Table2,Table3)

     

     

    Best Regards,

    Amy

     

    Community Support Team _ Amy

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • cmdrfruitcakes's avatar
      cmdrfruitcakes
      New Member

      This is a really simple feature that should be present - it's absolutely absurd to not allow custom columns for the interface used for joining and apending. Program is total trash