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.
Hola
Tengo 2 tablas que se muestran a continuación, están relacionadas por ID (Cuenta) e ID de cuenta (Producto)
Cuenta | ||
Nombre de la cuenta | IDENTIFICACIÓN | País |
Acc1 | AC1 | NOS |
Acc2 | AC2 | NOS |
Producto | |||
ID de producto | ID de cuenta | Dueño | Tipo |
PRD1 | AC1 | Micrófono | Tipo1 |
PRD1 | AC1 | AM | Tipo2 |
PRD2 | AC1 | Juan | Tipo1 |
PRD2 | AC1 | Sara | Tipo2 |
Y quiero la salida en una tabla dinámica
NOS | SG | |
Propietario (Tipo) | Propietario (Tipo) | |
PRD1 | Mike (Tipo1) Sam (Tipo2) | |
PRD2 | Juan(Tipo1) Sara(Tipo2) |
El volumen de datos es cercano a un millón en la tabla de cuentas, por lo que también debe tener en cuenta el rendimiento.
gracias por investigar esto.
Solved! Go to Solution.
@PBIfanatic
Cree la siguiente medida:
Owner Type =
IF(
ISINSCOPE( 'Product'[Product ID]) && ISINSCOPE( 'Account'[Country]),
CONCATENATEX(
SUMMARIZE('Product' ,'Product'[Owner] ,'Product'[Type] ),
'Product'[Owner] & "(" & 'Product'[Type] &")" & UNICHAR(10)
)
)
@PBIfanatic
Cree la siguiente medida:
Owner Type =
IF(
ISINSCOPE( 'Product'[Product ID]) && ISINSCOPE( 'Account'[Country]),
CONCATENATEX(
SUMMARIZE('Product' ,'Product'[Owner] ,'Product'[Type] ),
'Product'[Owner] & "(" & 'Product'[Type] &")" & UNICHAR(10)
)
)
@PBIfanatic
¡Bien!
Siga adelante y acepte una solución si funciona para usted, esto ayudará a otros que buscan soluciones similares a encontrarla fácilmente.
Parece extraño que una columna SG salga de la nada de su conjunto de datos simulado.
Lo que sea, es una simple transformación en PQ
let
Account = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WckxONlTSUXJ0BpGhwUqxOmAxI7CYEUIMzI8PdgfSQCI2FgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Account Name" = _t, ID = _t, Country = _t]),
Product = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCghyMVTSUXJ0BpG+mdmpQCqksiDVUClWB002ODEXKmkEkzSCS3rlZ+ShazVC0lqUiKI32D0eqAAsHx/sDqT98pPyUyqhaiKUYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Product ID" = _t, #"Account ID" = _t, Owner = _t, Type = _t]),
#"Combined Columns" = Table.CombineColumns(Product, {"Owner", "Type"}, each _{0}&" ("&_{1}&")", "Owner (Type)"),
#"Grouped Rows" = Table.Group(#"Combined Columns", {"Product ID", "Account ID"}, {{"ar", each Text.Combine([#"Owner (Type)"], "#(lf)")}}),
#"Merged Tables" = Table.NestedJoin(#"Grouped Rows", "Account ID", Account, "ID", "merged", JoinKind.LeftOuter),
#"Expanded merged" = Table.RemoveColumns(Table.ExpandTableColumn(#"Merged Tables", "merged", {"Country"}, {"Country"}), "Account ID"),
#"Pivoted Column" = Table.Pivot(#"Expanded merged", List.Distinct(#"Expanded merged"[Country]), "Country", "ar")
in
#"Pivoted Column"
hay @CNENFRNL
¿Cómo obtengo la agrupación? Cuando pruebo la opción Agrupar por en la pestaña Inicio, no me permite hacer esto sin una medida.
#"Filas agrupadas" = Table.Group(#"Columnas combinadas", {"ID de producto", "ID de cuenta"}, {{"ar", cada Text.Combine([#"Propietario (Tipo)"], "#(lf)")}}),
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 |
---|---|
2 | |
2 | |
2 | |
2 | |
1 |