Forum Discussion
Power Query - Self Referencing Tables for adding comments etc
- Sep 27, 2022
davidmaddock54 The posting you referred to included one link (of many) to an article about how to create self referencing tables in PQ. Looking at your particular situation, perhaps the attached version works better for you. All is condensed into one query.
See if you can follow the steps, though it required some manipulation of the M-code. The key is that you create two Sources and merge one to the other within the same query.
davidmaddock54 The posting you referred to included one link (of many) to an article about how to create self referencing tables in PQ. Looking at your particular situation, perhaps the attached version works better for you. All is condensed into one query.
See if you can follow the steps, though it required some manipulation of the M-code. The key is that you create two Sources and merge one to the other within the same query.
Hello. I have been trying to create a Self Referencing Table with 4 additional collumns from my query / pivot table. I have gotten to the very end, however every time I import my merged queries, it is showing duplicate columns.
- SergeiBaklanSep 27, 2023MVP
Just remove duplicated columns in the resulting table and refresh. The won't appear again. If you merge correctly.
- mollynoel98Sep 27, 2023Copper Contributor
The problem is the table that it is duplicating is linked to my query as the "template" for how I want my page to look. If I remove the columns, then my query breaks. SergeiBaklan
- SergeiBaklanSep 27, 2023MVP
Perhaps we misunderstood each other. How self-referencing works:
- we have some query which returns table into the grid. Such query/table shall have column with unique values (Id)
- we add to that returned table some columns and query such expanded table
- within initial query (not as separate query) we add merging of latest step of initial query with query which takes the table with additional columns
- we may use helper query to perform above merging, copy/paste steps into initial query and remove helper query. Thus we have only one query for that.
- after returning modified initial query into the grid it could appear duplicated columns which were added manually, we only need to remove them and refresh again. They won't appear if additional columns are added after the merging in the query.
That could be other modifications, general idea is we work with one table and one query.