How to merge queries in power bi with 2 primary keys

你说的曾经没有我的故事 提交于 2020-06-28 05:07:42

问题


How do we merge two queries in power bi when the primary key is a combination of 2 columns.

for example i have 2 tables

Table A :

year
cost center
col a
col b
col c

Table B:

year
cost center
col x
col y
col z

The primary key in both the columns is a combination of the 1st two columns. How do i merge these two queries?


回答1:


When you merge the queries using the GUI, you can hold down Ctrl to select multiple columns from each table. (Make sure you select them in the same order on both tables.)




回答2:


  1. Either create a new combined column from year and cost center (in one table this key has to be unique) and use this new key for your relationship
  2. Or merge both tables into a new table and than you can pick multiple columns to join on.


来源:https://stackoverflow.com/questions/61499573/how-to-merge-queries-in-power-bi-with-2-primary-keys

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!