Forum Discussion
Duplicate values while merging columns
- 2 years ago
Hi alicia_mtz,
I've prepared the same result you are requesting by adding the company field in the sales table which stated "Nike" for all the rows, and by appending the sales table with the forecast table. I just used the PQ ribbons which produced the following M codes as I am not that conversant with M.
Hi alicia_mtz,
I've prepared the same result you are requesting by adding the company field in the sales table which stated "Nike" for all the rows, and by appending the sales table with the forecast table. I just used the PQ ribbons which produced the following M codes as I am not that conversant with M.
Hi DataNinja777 ,
Yes, that's what I want! However I'm trying to replicate your steps but I'm not getting the same results as you.
This is what I get:
Can you post a screen of the Groupby step to see if I'm doing it correctly, please? 🙂 I'm not sure which step I'm doing wrong.
Thank you!
- DataNinja7772 years agoSuper User
Hi alicia_mtz,
= Table.Group(#"Appended Query", {"Company", "Product"}, {{"Sales", each List.Sum([Sales]), type nullable number}, {"Forecast", each List.Sum([Forecast]), type nullable number}})I copied and pasted that group by step above. It was generated by clicking on the ribbons.
- Anonymous2 years agoNot applicable
Hi DataNinja777
I've copied your line of code but it still gives me the same result, not your result, I don't know why 😞
Thanks
- DataNinja7772 years agoSuper User
Hi alicia_mtz,
Looking at your file, I think your source table for the sales still do not contain the company field which two "Nike" rows, therefore, it is showing null the top two lines. What I did was to assign "Nike" in the source data for the sales table, in the additional row created with the name "Company", so that forecast table and sales table can be just apended. If you have any problem, please feel free to attach here your pbix file. I will be able to fix it for you.