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
Sam82
Frequent Visitor

Combining 2 columns from 2 different tables into one column

Hi All,

Please kindly can you help!

I have 2 tables as showing below 

Table 1 name = "TableA"

DLL Business UnitOpportunity Name/ FO Application #Customer NameAccount Name (Originator)First Docs In Date/TimeNet NBVSales Support OwnerSales StageSales Sub StageReason for Audit Rejection
Constr. Transp. & Industrial8.2621E+13D O Constable ContractorErnest Doe & Sons Ltd25/03/2020 08:43 UK_SPOC_CV_Flow_WIP4.Accepted4.5 Clarification on docsCredit;Fraud Checklist

 

Table 2 name = "TableB"

BUContract NoDate & Time ReceivedCustomer name
Constr. Transp. & Industrial8262145001911926/03/2020 10:08JHD Bowen Building Contractor

 

 

Question Please;

- I would like to extract all the data in column "Opportunity Name/ FO Application #" from TableA, and all the data in column "Contract No" in TableB. As you notice there is no direct link between the 2 tables. Is there a solution to pull all the data from the 2 columns in to one column (only distinct value)? Many thanks 

Kind Regards

Sarmad Dra

1 ACCEPTED SOLUTION

Hi @Sam82

 

It seems that you are missing a ")"that will occur such error:

Annotation 2020-04-01 170827.png

 

I tested again and the function works fine.

Annotation 2020-04-01 171417.png

 

Here is a sample .pbix file you can refer to.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
 

View solution in original post

6 REPLIES 6
v-kelly-msft
Community Support
Community Support

Hi  @Sam82 ,

 

Create a table using below dax expression:

 

 

Table C= UNION(ALL(TableA[Opportunity Name/ FO Application #]) , ALL(TableB[Contract No]) ))

 

 

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

when I use the following; 

Table C= UNION(ALL(TableA[Opportunity Name/ FO Application #]) , ALL(TableB[Contract No]) ))

I am getting this error "Too few arguments were passed to the UNION function. The minimum argument count for the function is 2."

Do you know whye?

Thank you,

Sam

amitchandak
Super User
Super User

You can create a new table like this

distinct(union(all(TableA[Opportunity Name/ FO Application #]) , all(TableB[Contract No]) ))

when I use the following; 

distinct(union(all(TableA[Opportunity Name/ FO Application #]) , all(TableB[Contract No]) ))

 

I am getting this error "Too few arguments were passed to the UNION function. The minimum argument count for the function is 2."

Do you know whye?

Thank you,

Sam

Hi @Sam82

 

It seems that you are missing a ")"that will occur such error:

Annotation 2020-04-01 170827.png

 

I tested again and the function works fine.

Annotation 2020-04-01 171417.png

 

Here is a sample .pbix file you can refer to.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
 
edhans
Super User
Super User

Yes, you would do this in Power Query using a Cartesian Join, but I'll need good data to play with. See the links below. I cannot use what you pasted in because it is not in a table format and I'll spend more time cleaning up random spaces and special char 160 spaces than actually working on the problem.

 

How to get good help fast. Help us help you.
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

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.