Forum Discussion
Refresh error duplicate values in the table
Thank you for your reply. Would adding an index column as the primary key column work?
- halfglassdarkly2 years agoResponsive Resident
Only if the index in both tables corresponds to the record with the same department / date combination. You'd be better off creating a new key that concatenates the department/date.
An alternative if you have access to edit the tables in PowerQuery and if you don't actually need your leavers data in a seperate table would be to merge the two tables in PowerQuery prior to loading into PowerBI since unlike PowerBI, PowerQuery does support joining tables using composite keys.- Naomig20882 years agoHelper II
Forgive me, I'm fairly new to Power BI. How would I go about creating a new key that concatenates the department/date please?
- halfglassdarkly2 years agoResponsive Resident
In PowerBI, just create a new calculated column in each table, e.g.
UniqueID = 'Leavers for Turnover'[StartofMonthLeaveDate] & 'Leavers for Turnover'[Positions V2 (2). DepartmentNumber]
You'll need to swap out the table name 'Leavers for Turnover' for the relevant table name when adding it to the other table.Alternatively you could create the new key in PowerQuery using merge columns see https://support.microsoft.com/en-us/office/merge-columns-power-query-80ec9e1e-1eb6-4048-b500-d5d42d9f0a8d#:~:text=In%20the%20Custom%20Column%20Formula%20box%2C%20enter%20an%20ampersand%20(%26,after%20the%20ampersand%20(%26).
Then once you have your new key in each table you'll need to remap the two tables using the new key in the schema view.