Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

How to append tables and keep their original name

Hello,

 

I would like to append three tables (see below) but to give a particular name to the global table.

Is it possible to do that and if so how.

 

Imagine that I have those table

 

Table A

Table B

Table C

 

If I append table A, to table B and to table C, the end result will be the content of all those tables but with the name of the global table will be Table A.  Also, It will be possible to see the content of table B and table C but I assumes that Table A will have lost it original content which will be replaced by the content of the three tables.

 

What I would like to do it is to create a table let's say Table 1 which will content table A , B, C .  After that append operation, I would like to be able to see the particular content of each table.

 

ex:

Table 1 (Table A + Table B + Table C)

Table A

Table B

Table C

 

1 ACCEPTED SOLUTION
v-lid-msft
Community Support
Community Support

Hi @Anonymous ,

 

We can create a newquery using following formula in the Power Query Editor to meet your requirement:

 

let
    tableA = Table.Group(Table.AddColumn(#"Table A", "Table Name", each "Table A"), {"Table Name"}, {{"Table Content", each _, type table [Name=text, Value=number, Table Name=text]}}),
    tableB = Table.Group(Table.AddColumn(#"Table B", "Table Name", each "Table B"), {"Table Name"}, {{"Table Content", each _, type table [Name=text, Value=number, Table Name=text]}}),
    tableC = Table.Group(Table.AddColumn(#"Table C", "Table Name", each "Table C"), {"Table Name"}, {{"Table Content", each _, type table [Name=text, Value=number, Table Name=text]}}),
    Source = Table.Combine({tableA,tableB,tableC})
in
    Source

 

change the part of [Name=text, Value=number, Table Name=text] based on the columns in your origin table.

 

7.PNG

 

Then we can expand all of them or just one:

 

8.PNG

 


BTW, pbix as attached.

 

Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-lid-msft
Community Support
Community Support

Hi @Anonymous ,

 

We can create a newquery using following formula in the Power Query Editor to meet your requirement:

 

let
    tableA = Table.Group(Table.AddColumn(#"Table A", "Table Name", each "Table A"), {"Table Name"}, {{"Table Content", each _, type table [Name=text, Value=number, Table Name=text]}}),
    tableB = Table.Group(Table.AddColumn(#"Table B", "Table Name", each "Table B"), {"Table Name"}, {{"Table Content", each _, type table [Name=text, Value=number, Table Name=text]}}),
    tableC = Table.Group(Table.AddColumn(#"Table C", "Table Name", each "Table C"), {"Table Name"}, {{"Table Content", each _, type table [Name=text, Value=number, Table Name=text]}}),
    Source = Table.Combine({tableA,tableB,tableC})
in
    Source

 

change the part of [Name=text, Value=number, Table Name=text] based on the columns in your origin table.

 

7.PNG

 

Then we can expand all of them or just one:

 

8.PNG

 


BTW, pbix as attached.

 

Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

you should able to do is using union or union and SUMMARIZE. In SUMMARIZE you can static column to give the table name

 

Balance Sheet = union(SUMMARIZE(Sales,Sales[Brand],"Col1",sum(Sales[Sales]),"Col2",sum(Sales[COGS]),"sort",COUNTROWS(Sales)),SUMMARIZE(Sales,Sales[Brand],"Col1",sum(Sales[Sales]),"Col2",sum(Sales[COGS]),"sort",0) )

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

My Recent Blog - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.