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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
lg01
Advocate II
Advocate II

Create table and add rows

I have several tables in my project and in all of them I have a column called "Approved?"  What I'd like to do is create a new table, add two columns, one called "Approved?" and the other called "Source". Then I'd like to add the data from the different tables to populate my new table. Once this new table is populated, it will look something like this:

 

Approved?, Source

Yes, Table1

No, Table1

Yes, Table1

Yes, Table2

Yes, Table2

No, Table2

Yes, Table2

Yes, Table3

Yes, Table3

No, Table4

Yes, Table4

 

Any ideas of the syntax for this?

1 ACCEPTED SOLUTION
SamsonTruong
Super User
Super User

Hi @lg01 ,

This can be achieved with a DAX calculated table like so:

NewTable =
UNION(
    SELECTCOLUMNS(Table1, "Approved?", Table1[Approved?], "Source", "Table1"),
    SELECTCOLUMNS(Table2, "Approved?", Table2[Approved?], "Source", "Table2"),
    SELECTCOLUMNS(Table3, "Approved?", Table3[Approved?], "Source", "Table3"),
    SELECTCOLUMNS(Table4, "Approved?", Table4[Approved?], "Source", "Table4")
)

 
Before implementing this, make sure to replace the tables with your actual tables and add additional lines based on the number of tables you have. 

If this helped, please mark it as the solution so others can benefit too. And if you found it useful, kudos are always appreciated.

Thanks,

Samson

 

Connect with me on LinkedIn

Check out my Blog

Going to the European Microsoft Fabric Community Conference? Check out my Session

View solution in original post

2 REPLIES 2
Rueen1941
New Member

very detailed! thanks

SamsonTruong
Super User
Super User

Hi @lg01 ,

This can be achieved with a DAX calculated table like so:

NewTable =
UNION(
    SELECTCOLUMNS(Table1, "Approved?", Table1[Approved?], "Source", "Table1"),
    SELECTCOLUMNS(Table2, "Approved?", Table2[Approved?], "Source", "Table2"),
    SELECTCOLUMNS(Table3, "Approved?", Table3[Approved?], "Source", "Table3"),
    SELECTCOLUMNS(Table4, "Approved?", Table4[Approved?], "Source", "Table4")
)

 
Before implementing this, make sure to replace the tables with your actual tables and add additional lines based on the number of tables you have. 

If this helped, please mark it as the solution so others can benefit too. And if you found it useful, kudos are always appreciated.

Thanks,

Samson

 

Connect with me on LinkedIn

Check out my Blog

Going to the European Microsoft Fabric Community Conference? Check out my Session

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.