Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hola, tenemos dos tablas en pbix, "Table1" y "Table2".
¿puede alguien ayudarme a escribir una "Medida" para este requisito? que pueden reemplazar los valores de la tabla 1 por la tabla 2 (no hay relaton entre tablas).
Gracias de antemano.
Hola @yodha ,
Por favor, compruebe:
1. Intente reemplazar el valor en el editor de Power Query.
= Table.ReplaceValue(#"Changed Type",each [Value], each if [Group]=false and [Type] = false and [#"Sub-type"]=false then (let Name_ = [Name] in Table.SelectRows(#"Table 2", each [Name] = Name_ and [Type] = "new")){0}[Value] else [Value],Replacer.ReplaceValue,{"Value"})
2. O bien, puede crear una columna calculada o una medida en Power BI Desktop.
Column =
IF (
'Table 1'[Group] && 'Table 1'[Type]
&& 'Table 1'[Sub-type],
'Table 1'[Value],
CALCULATE (
SUM ( 'Table 2'[Value] ),
FILTER (
'Table 2',
'Table 2'[Name] = 'Table 1'[Name]
&& 'Table 2'[Type] = "new"
)
)
)
Measure =
IF (
SELECTEDVALUE ( 'Table 1'[Group] ) && SELECTEDVALUE ( 'Table 1'[Type] )
&& SELECTEDVALUE ( 'Table 1'[Sub-type] ),
SUM ( 'Table 1'[Value] ),
CALCULATE (
SUM ( 'Table 2'[Value] ),
FILTER (
'Table 2',
'Table 2'[Name] = SELECTEDVALUE ( 'Table 1'[Name] )
&& 'Table 2'[Type] = "new"
)
)
)
BTW, archivo .pbix adjunto.
Saludos
Icey
Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
Hola @yodha ,
¿Por qué no usa Power Query?
Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials
@mwegener Sí, Powerquery también funciona, pero soy nuevo en Power BI y no sé cómo obtener el resultado esperado mediante la consulta de energía. ¡Gracias!
Hola @yodha ,
Iría paso a paso.
1. Genere columnas en la tabla 2 que necesita vincular a la tabla 1. (Columnas condicionales)
2. Combine las tablas sobre estas columnas.
3. Busque el valor deseado utilizando una columna condicional.
Eche un vistazo al PBIX adjunto.
Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.