Forum Discussion

Medmanage101's avatar
Medmanage101
Frequent Visitor
5 years ago
Solved

Merging Fields

I have 4 fields with the exact same columns.  I just want them to merge into one big field of data.  I could have done that first in Excel but I'm sure Power BI can do it for me.  (New to Power BI)

  • I have 4 speadsheets loaded to my Power BI document. All of them have identical headers and identical # of columns.  I just want there to be one.  Hope that helps my question.  (Maybe I don't need to merge them at all and I'm trying to do something not needed.??)

     

  • Hi, Medmanage101 

    According to your description, you have 4 tables which have identical headers and identical # of columns. In this case, I think you have two ways to combine them into one table:

    One is using the “Append query” in the power query editor, like this:

     

    Then add all the 4 tables into it:

     

    Another is using the Union() function to create a calculated table in the Power BI:

     

    Table=
    
    Union(Table1, Table2, Table3, Table4)

    More info about the Union() function in DAX

     

    Then you can achieve your requirement.

    Thank you very much!

     

    Best Regards,

    Community Support Team _Robert Qin

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

3 Replies

  • Medmanage101's avatar
    Medmanage101
    Frequent Visitor

    I have 4 speadsheets loaded to my Power BI document. All of them have identical headers and identical # of columns.  I just want there to be one.  Hope that helps my question.  (Maybe I don't need to merge them at all and I'm trying to do something not needed.??)

     

  • selimovd's avatar
    selimovd
    Most Valuable Professional

    Hey Medmanage101 ,

     

    your description is not really clear for me as you are mixing fields and columns.

    But you can combine column, for example directly in Power Query:

    Merge columns (Power Query) - Excel (microsoft.com)

     

    Or in DAX as a calculated column if they are text:

    MyNewColumn = myTable[ColumnA] & myTable[ColumnB] & myTable[ColumnC]

      

    Or combine them with a separator:

    MyNewColumn = myTable[ColumnA] & "_" & myTable[ColumnB] & "_" & myTable[ColumnC]

     

    If you need any help please let me know.
    If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
     
    Best regards
    Denis
     
  • v-robertq-msft's avatar
    v-robertq-msft
    Community Support

    Hi, Medmanage101 

    According to your description, you have 4 tables which have identical headers and identical # of columns. In this case, I think you have two ways to combine them into one table:

    One is using the “Append query” in the power query editor, like this:

     

    Then add all the 4 tables into it:

     

    Another is using the Union() function to create a calculated table in the Power BI:

     

    Table=
    
    Union(Table1, Table2, Table3, Table4)

    More info about the Union() function in DAX

     

    Then you can achieve your requirement.

    Thank you very much!

     

    Best Regards,

    Community Support Team _Robert Qin

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