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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
janwillem
Frequent Visitor

Combine same tables with from different companies

Question:

 

I have following:

 

Company A -      Table: Puchase Line                        Column: Qty Purchase Line

                                                                                                 Qty Received

                                                                                                 Qty to Receive

                               In the table is not company in it;

 

Company B -      Table: Puchase Line                        Column: Qty Purchase Line

                                                                                                 Qty Received

                                                                                                 Qty to Receive

                               In the table is not company in it;

 

I will the following:

 

Qty Purchase Line:          Company A + B

Qty Received:                   Company A + B

Qty to Receive:                Company A + B

 

And a slicer, so that I can see the companies separated.

 

Is this possible?

 

1 ACCEPTED SOLUTION
v-caliao-msft
Employee
Employee

@janwillem,

 

The steps below are for you reference.

  1. Sample data
    Table1:CompanyA
    Capture.PNG
    Table2:CompanyB
    Capture1.PNG
  2. Edit add a Company to both table.
    Capture2.PNG
    Capture3.PNG
  3. Append Queries
    Capture5.PNG
  4. Then use this new table in your visual.
    Untitled.png

Regards,

Charlie Liao

View solution in original post

2 REPLIES 2
v-caliao-msft
Employee
Employee

@janwillem,

 

The steps below are for you reference.

  1. Sample data
    Table1:CompanyA
    Capture.PNG
    Table2:CompanyB
    Capture1.PNG
  2. Edit add a Company to both table.
    Capture2.PNG
    Capture3.PNG
  3. Append Queries
    Capture5.PNG
  4. Then use this new table in your visual.
    Untitled.png

Regards,

Charlie Liao

In our situation we have 10 companies; but that shouldn't be a problem (I think).

Added a column in each (company)query (name query and company has to different - so far so good).

In our case the primary key of a table is YearWeek.

In the table itself this key is unique. However combined not (then there are 10 the same primary keys).

 

After applying the query changes I got of course the following message:

Column "YearWeek" in Table 001 contains a duplicate value "201601" and this is not allowed for columns on the one side of a many-to-one relationship or for coluns that are used as the primary key of a table.

 

What is the best way to add unique primary keys to each table or an other way to solve this ?

 

TIA for replying

Helpful resources

Announcements
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.