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
Estoy luchando para averiguar cómo lograr lo que quiero en PowerBI. Tengo una tabla de clientes (Table1), con una fila "Compartido".
Lo que quiero hacer es tomar el valor de 'Compartido' de Table1, y agregar el valor a cada fila de cliente, basado en la distribución de precentage en Table2. ¿Es posible algo así?
Por ejemplo, a continuación, el Cliente A se convertiría en '280' y el Cliente B se convertiría en '220'
Tabla1
Cliente A | 100 |
Cliente B | 200 |
Compartido | 300 |
Tabla2
Cliente A | 60% |
Cliente B | 40% |
Solved! Go to Solution.
Hola @james2345
probar una columna como
Column =
var _shared = MAXX(FILTER(Table1, Table1[Customer] = "Shared"), Table1[Value])
RETURN
RELATED(Table1[Value]) + Table2[Percent]*_shared
pero asegúrese de que tiene relaciones entre las tablas
Hola @james2345
Consulte el archivo adjunto con una solución en Power Query o el siguiente script
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wci4tLsnPTS1ScFTSUTI0MFCK1UESdAIKGkEFgzMSi1JTgALGIIFYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Customer = _t, Value = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Customer", type text}, {"Value", Int64.Type}}),
#"Merged Queries" = Table.NestedJoin(#"Changed Type", {"Customer"}, Table2, {"Shared"}, "Table2", JoinKind.LeftOuter),
#"Expanded Table2" = Table.ExpandTableColumn(#"Merged Queries", "Table2", {"Customer", "Split"}, {"Table2.Customer", "Table2.Split"}),
#"Replaced Value" = Table.ReplaceValue(#"Expanded Table2",null,1,Replacer.ReplaceValue,{"Table2.Split"}),
#"Added Conditional Column" = Table.AddColumn(#"Replaced Value", "New Customer", each if [Table2.Customer] = null then [Customer] else [Table2.Customer], type text ),
#"Added Custom" = Table.AddColumn(#"Added Conditional Column", "New Value", each [Value] * [Table2.Split], type number ),
#"Grouped Rows" = Table.Group(#"Added Custom", {"New Customer"}, {{"New Value ", each List.Sum([New Value]), type number}})
in
#"Grouped Rows"
Hola @james2345
probar una columna como
Column =
var _shared = MAXX(FILTER(Table1, Table1[Customer] = "Shared"), Table1[Value])
RETURN
RELATED(Table1[Value]) + Table2[Percent]*_shared
pero asegúrese de que tiene relaciones entre las tablas
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 | |
1 | |
1 | |
1 | |
1 |
User | Count |
---|---|
2 | |
2 | |
2 | |
1 | |
1 |