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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Constant value in a column for each table in DAX UNION

Hi All,

 

I'm still learning Power BI DAX and coudn't find a good example in the forum as per my requirement.

 

I have two tables TABLE_A and TABLE_B, I need to UNION these two tables and add a new column with constant value to the result to indicate the row belogs to which table.

 

Example below with expected output and more important is to have the same column headers like "Source", "TSID", "Product" and "Location".

 

Sara_K_0-1678484384786.png

 

Thanks

Sara

 

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User
3 REPLIES 3
Ahmedx
Super User
Super User

Anonymous
Not applicable

Thanks @Ahmedx 

@AFrathanks for your suggestion, but I wanted to do only using DAX.

AFra
Helper III
Helper III

you can easily do it in on Power query : 

1. you add for each table a column named Source = TABLE A or B

2. append table B on table A

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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