Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Mi tabla tiene alrededor de 500K filas con la siguiente estructura:
Quiero combinar la columna Dirección.
¿Alguien puede ayudar?
¡Gracias!
Solved! Go to Solution.
Pruebe esto en Power Query. El paso Origen será su origen de datos. Utilicé un delimitador de comas en el paso GroupAddress; puede utilizar cualquier delimitador.
let
Source = Table.FromRows(
Json.Document(
Binary.Decompress(
Binary.FromText(
"i45WMlTSUXJ0cgaShgYGSrE60UpApourG5CE8dw9PGE8IyDDy9sHpNoUrtrXzx9JdUBgEIxnDGQEh4QCSUtLS5h8WEQkkuqoqCgwLxYA",
BinaryEncoding.Base64
),
Compression.Deflate
)
),
let
_t = ((type nullable text) meta [Serialized.Text = true])
in
type table [Id = _t, Address = _t, Sales = _t]
),
ChangeType = Table.TransformColumnTypes(
Source,
{{"Id", Int64.Type}, {"Address", type text}, {"Sales", Int64.Type}}
),
FillDownId = Table.FillDown(ChangeType, {"Id"}),
GroupAddress = Table.Group(
FillDownId,
{"Id"},
{{"Combined Address", each Text.Combine([Address], ", "), type text}}
),
TableAmount = Table.SelectRows(
Table.SelectColumns(ChangeType, {"Id", "Sales"}),
each ([Id] <> null)
),
TableJoin = Table.NestedJoin(
TableAmount,
{"Id"},
GroupAddress,
{"Id"},
"TableAddress",
JoinKind.Inner
),
ExpandTable = Table.ExpandTableColumn(
TableJoin,
"TableAddress",
{"Combined Address"},
{"Combined Address"}
)
in
ExpandTable
@DataInsights no tratando de pisar los dedos de los dedos de los en los dedos de los dos, pero en esta solución la unión se puede evitar y esto puede optimizar el rendimiento dramáticamente en un tbl grande.
let
Source = Table.FromRows(
Json.Document(
Binary.Decompress(
Binary.FromText(
"i45WMlTSUXJ0cgaShgYGSrE60UpApourG5CE8dw9PGE8IyDDy9sHpNoUrtrXzx9JdUBgEIxnDGQEh4QCSUtLS5h8WEQkkuqoqCgwLxYA",
BinaryEncoding.Base64
),
Compression.Deflate
)
),
let
_t = ((type nullable text) meta [Serialized.Text = true])
in
type table [Id = _t, Address = _t, Sales = _t]
),
ChangeType = Table.TransformColumnTypes(
Source,
{{"Id", Int64.Type}, {"Address", type text}, {"Sales", Int64.Type}}
),
FillDownId = Table.FillDown(ChangeType, {"Id"}),
GroupAddress = Table.Group(
FillDownId,
{"Id"},
{{"Combined Address", each Text.Combine([Address], ", "), type text},{"max", each List.Max([Sales]), type nullable number}}
)
in
GroupAddress
@DataInsights no tratando de pisar los dedos de los dedos de los en los dedos de los dos, pero en esta solución la unión se puede evitar y esto puede optimizar el rendimiento dramáticamente en un tbl grande.
let
Source = Table.FromRows(
Json.Document(
Binary.Decompress(
Binary.FromText(
"i45WMlTSUXJ0cgaShgYGSrE60UpApourG5CE8dw9PGE8IyDDy9sHpNoUrtrXzx9JdUBgEIxnDGQEh4QCSUtLS5h8WEQkkuqoqCgwLxYA",
BinaryEncoding.Base64
),
Compression.Deflate
)
),
let
_t = ((type nullable text) meta [Serialized.Text = true])
in
type table [Id = _t, Address = _t, Sales = _t]
),
ChangeType = Table.TransformColumnTypes(
Source,
{{"Id", Int64.Type}, {"Address", type text}, {"Sales", Int64.Type}}
),
FillDownId = Table.FillDown(ChangeType, {"Id"}),
GroupAddress = Table.Group(
FillDownId,
{"Id"},
{{"Combined Address", each Text.Combine([Address], ", "), type text},{"max", each List.Max([Sales]), type nullable number}}
)
in
GroupAddress
Pruebe esto en Power Query. El paso Origen será su origen de datos. Utilicé un delimitador de comas en el paso GroupAddress; puede utilizar cualquier delimitador.
let
Source = Table.FromRows(
Json.Document(
Binary.Decompress(
Binary.FromText(
"i45WMlTSUXJ0cgaShgYGSrE60UpApourG5CE8dw9PGE8IyDDy9sHpNoUrtrXzx9JdUBgEIxnDGQEh4QCSUtLS5h8WEQkkuqoqCgwLxYA",
BinaryEncoding.Base64
),
Compression.Deflate
)
),
let
_t = ((type nullable text) meta [Serialized.Text = true])
in
type table [Id = _t, Address = _t, Sales = _t]
),
ChangeType = Table.TransformColumnTypes(
Source,
{{"Id", Int64.Type}, {"Address", type text}, {"Sales", Int64.Type}}
),
FillDownId = Table.FillDown(ChangeType, {"Id"}),
GroupAddress = Table.Group(
FillDownId,
{"Id"},
{{"Combined Address", each Text.Combine([Address], ", "), type text}}
),
TableAmount = Table.SelectRows(
Table.SelectColumns(ChangeType, {"Id", "Sales"}),
each ([Id] <> null)
),
TableJoin = Table.NestedJoin(
TableAmount,
{"Id"},
GroupAddress,
{"Id"},
"TableAddress",
JoinKind.Inner
),
ExpandTable = Table.ExpandTableColumn(
TableJoin,
"TableAddress",
{"Combined Address"},
{"Combined Address"}
)
in
ExpandTable
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |
User | Count |
---|---|
2 | |
2 | |
1 | |
1 | |
1 |