Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hiya good people,
I am trying to solve, possibly a wierd problem. I have a table as below :
What I want to do is as follows :
In each of the table under the [Data] column, i want to insert a column which will populate the new column with the corresponding name under the column [Account]. E.g. In the 1st table, from the [Data] column, I would like to insert a column, filled with the account name, "JioMart"
If I simply use Table.AddColumn, I am getting an error.
Is there a way to solve this in power query?
Any help much appreciated
Solved! Go to Solution.
NewStep=Table.ReplaceValue(PreviousStepName,each [Account],"",(x,y,z)=>Table.AddColumn(x,"Account",each y),{"Data"})
@wdx223_Daniel - That worked like a charm, although I could not understand the logic fully...
E.g. how is the function getting its values for x,y & z?
the 4th parameter of Table.ReplaceValue is a function of Replacer.ReplaceText or Replacer.ReplaceValue
and, about the syntax of those function you can refer to this site.
https://learn.microsoft.com/en-us/powerquery-m/replacer-functions
NewStep=Table.ReplaceValue(PreviousStepName,each [Account],"",(x,y,z)=>Table.AddColumn(x,"Account",each y),{"Data"})
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 4 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 16 | |
| 14 | |
| 12 | |
| 7 | |
| 6 |