Forum Discussion
Column exchange with a calculated column?
- 11 months ago
Hi TA_ ,
What are the columns you are using for the merge? Looking at the DAX code you should do the merge on the Info Table and match the Map_WE_ME[OldKey] with the Info[ID_WE_ME] then expand the Map_WE_ME[NewKey] on the resulting column. After that Replace the null by the Info[ID_WE_ME]
How are you setting the merge on the tables? Is on the info table or on the Map table?Can you share that specific line of code please.
Hi,
in my case, the mentioned way of recreating a column in powerquery and then merging it with my other table should be the correct way. Unfortunately i do get null values, but I do believe that my data might be corrupted. Anyways, the steps serve my purpose and sooner or later will get me to the point where I need it to be.
Thanks for the advises!
Hi TA_ ,
When you received null values it means that you do not have corresponding values on the merge tables on this case you must replace your nulls by the Info[ID_WE_ME] field that is the second part of the coalesce that you are doing in the DAX formula.
- TA_11 months agoRegular Visitor
Hi Felix,
unfortunately, the data of the Info table and my reference table do not match at all. I am not certain about the source of error, but since this dashboard was created by another person i might just rebuild the entire project and set everything up in a way i can locate potential errors without guessing what the thought process of my predecessor was.
- MFelix11 months agoSuper User
Hi TA_ ,
What are the columns you are using for the merge? Looking at the DAX code you should do the merge on the Info Table and match the Map_WE_ME[OldKey] with the Info[ID_WE_ME] then expand the Map_WE_ME[NewKey] on the resulting column. After that Replace the null by the Info[ID_WE_ME]
How are you setting the merge on the tables? Is on the info table or on the Map table?Can you share that specific line of code please.- TA_11 months agoRegular Visitor
Hey MFelix
this is the target column of my Info table. Each key is a building. There are several cases where two keys are the same building. This happens because those unique keys changed. My goal is to replace the old ones.
This is my new table (Änderungen_G) containing the information about the changes of ME&WE.
I tried different ging options. In my first attempt I created a new column in Änderungen_G and called it ID_WE_ME with the old values for WE and ME. The next step was to merge queries (starting from my main table/Info) and selecting both ID_ME_WE columns. I chose Left Outer and no fuzzy matching. What I thought would happen is the option to expand my new merged column so i can see MEneu and WEneu, so i could create a new column ID_WE_ME with these and rename the outdated one. Sadly I received null values.
My second attempt was basicly the same merging but I chose both ME and WE from each table without creating a new column. Results were the same tho.
What I still do not understand isthe following; If I search for combination based on the Änderungen_G table within the Info table (in the table view of power BI or the excel table) I do get results. If I try the same thing within the power query editor I don´t get any results at all. I have no clue why, but this should be the reason I can not get any results of my merging, since there are no corresponding values.