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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.

Top Solution Authors