Forum Discussion
Joining multiple tables/queries
- 9 years ago
This will be the reason for the error.
One option is to create a new column that combine your CompanyID/CustomerID into a single column, which you can do in the Query Editor. This would need to be done in both tables to create the relationship.
Otherwise, you could combine both tables into 1 in Query Editor using the Merge command to create a table with the following columns
CompanyID , CustomerID , CustomerName , InvoiceNum
Cheers,
Phil
- 9 years ago
I think you're actually better off using that first suggestion - keep the two separate tables, but create concatenated key columns in both tables that combine the CompanyID and CustomerID columns, using these new columns to join the tables. This allows you to treat the customer table as a lookup table. As you start learning more about PowerBI, you'll see that this is the standard modelling approach.
You might be able to right click the table in the Query Editor and tell it not to refresh or load to the model. In which case it only exists to get data from your source into Power Query and deliver it to the merge.
I did both and it didn't work, looks like it really wants to keep it in there. Oh well.
Thanks for the help.
- Peter_R9 years agoResolver II
I think you're actually better off using that first suggestion - keep the two separate tables, but create concatenated key columns in both tables that combine the CompanyID and CustomerID columns, using these new columns to join the tables. This allows you to treat the customer table as a lookup table. As you start learning more about PowerBI, you'll see that this is the standard modelling approach.
- Machzy9 years agoHelper I
Switched to this, seems like a better strategy.
Thanks for the tip!