Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I have a requirement to add a column that takes values from a field in another column.
Example-
In other words, the new column should take the FieldValue of 'Vendor' for each unique RowID.
I would need this in Power Query. Kindly help.
Thanks.
Solved! Go to Solution.
@Zabeer
You can add custom column in PQ as follows: Replace "Previous Step" with your last step in the query
(x)=> Table.SelectRows(#"Previous Step", (y)=> y[ColumnID] = x[ColumnID] and y[Field] = "Vendor" )[FieldValue]{0}
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@Fowmy : Thanks for your reply. What parameters do I then need to invoke the function?
@Zabeer
You can click Column Column, paste the above code, click OK then remove the word "each" in the formula bar
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@Zabeer
You can add custom column in PQ as follows: Replace "Previous Step" with your last step in the query
(x)=> Table.SelectRows(#"Previous Step", (y)=> y[ColumnID] = x[ColumnID] and y[Field] = "Vendor" )[FieldValue]{0}
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group