We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
I am looking to pass through the value of a record to a nested table within the same record, below is an example table where I am trying to pass through Name from the parent record into the nested table. I have also commented out the function I was trying to use.
let
Source =
Table.FromRecords(
{
[CustomerID = 1, Name = "Bob", Order =
Table.FromRecords(
{
[TransactionID = 1, LineID = 1],
[TransactionID = 2, LineID = 2],
[TransactionID = 3, LineID = 3],
[TransactionID = 4, LineID = 4]
}
)
],
[CustomerID = 2, Name = "Jim", Order =
Table.FromRecords(
{
[TransactionID = 5, LineID = 1],
[TransactionID = 6, LineID = 2],
[TransactionID = 7, LineID = 3],
[TransactionID = 8, LineID = 4]
}
)
]
}
)
// CustomColumn = Table.AddColumn(Source, "Custom", each Table.AddColumn([Order],"Name",each _[Name]))
in
Source
Solved! Go to Solution.
Fount the Solution:
let
Source =
Table.FromRecords(
{
[CustomerID = 1, Name = "Bob", Order =
Table.FromRecords(
{
[TransactionID = 1, LineID = 1],
[TransactionID = 2, LineID = 2],
[TransactionID = 3, LineID = 3],
[TransactionID = 4, LineID = 4]
}
)
],
[CustomerID = 2, Name = "Jim", Order =
Table.FromRecords(
{
[TransactionID = 5, LineID = 1],
[TransactionID = 6, LineID = 2],
[TransactionID = 7, LineID = 3],
[TransactionID = 8, LineID = 4]
}
)
]
}
),
CustomTable =
Table.AddColumn(Source, "Custom",
each
let
ParentName = [Name],
AddName =
Table.AddColumn([Order],"
Name",
each
ParentName
)
in
AddName
)
in
CustomTable
Fount the Solution:
let
Source =
Table.FromRecords(
{
[CustomerID = 1, Name = "Bob", Order =
Table.FromRecords(
{
[TransactionID = 1, LineID = 1],
[TransactionID = 2, LineID = 2],
[TransactionID = 3, LineID = 3],
[TransactionID = 4, LineID = 4]
}
)
],
[CustomerID = 2, Name = "Jim", Order =
Table.FromRecords(
{
[TransactionID = 5, LineID = 1],
[TransactionID = 6, LineID = 2],
[TransactionID = 7, LineID = 3],
[TransactionID = 8, LineID = 4]
}
)
]
}
),
CustomTable =
Table.AddColumn(Source, "Custom",
each
let
ParentName = [Name],
AddName =
Table.AddColumn([Order],"
Name",
each
ParentName
)
in
AddName
)
in
CustomTable
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 6 | |
| 4 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 11 | |
| 10 | |
| 7 | |
| 7 | |
| 6 |