Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Nueva tabla con unión y otra columna

Hola Gurus - Esperando algo de ayuda, ya que no puedo encontrar mi problema exacto. ¡Gracias de antemano!

Tengo una tabla que contiene las siguientes columnas que me interesan;

Identificación interna

Etiqueta

Etiqueta1

Etiqueta2

Etiqueta3

Label4

Etiqueta5

Estoy buscando que las etiquetas se unen en 1 columnas con los IternalIDs correspending adecuados

Puedo unir las etiquetas

All_Archs - Distinto (
UNION(
SELECTCOLUMNS('pub dv_IndexedLabel', "Label", 'pub dv_IndexedLabel'[Etiqueta]),
SELECTCOLUMNS('pub dv_IndexedLabel', "Label", 'pub dv_IndexedLabel'[Label2]),
SELECTCOLUMNS('pub dv_IndexedLabel', "Label", 'pub dv_IndexedLabel'[Label3]),
SELECTCOLUMNS('pub dv_IndexedLabel', "Label", 'pub dv_IndexedLabel'[Label4]),
SELECTCOLUMNS('pub dv_IndexedLabel', "Label", 'pub dv_IndexedLabel'[Label5])))

y puedo enumerar los documentos internos,

SELECTCOLUMNS('pub dv_IndexedLabel', "InternalID", 'pub dv_IndexedLabel'[InternalID])

Pero estoy teniendo problemas para reunirlos. Cualquier ayuda que pueda proporcionar sería increíble!!!

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hola @HBAKER_JGD ,

Se sugiere utilizar "UnPivot". En Power Query Editor, intente seleccionar la columna "Internal ID" y luego vaya a "Transform" -> "UnPivot Columns" -> "UnPivot other columns".

Referencia: Pivote y despivo con Power BI

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.

View solution in original post

10 REPLIES 10
Icey
Community Support
Community Support

Hola @HBAKER_JGD ,

Se sugiere utilizar "UnPivot". En Power Query Editor, intente seleccionar la columna "Internal ID" y luego vaya a "Transform" -> "UnPivot Columns" -> "UnPivot other columns".

Referencia: Pivote y despivo con Power BI

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.

Greg_Deckler
Super User
Super User

@HBAKER_JGD - Tener problemas para visualizar lo que está pasando. ¿Puede proporcionar datos de ejemplo y resultados esperados?

No es realmente suficiente información para seguir adelante, por favor primero compruebe si su problema es un problema común enumerado aquí: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Además, consulte este post sobre cómo obtener respuesta a su pregunta rápidamente: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

Las partes más importantes son:
1. Datos de muestra como texto, utilice la herramienta de tabla en la barra de edición
2. Salida esperada de los datos de muestra
3. Explicación en palabras de cómo obtener de 1. a 2.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Espero que esto ayude;

Aquí están mis datos de muestra en el formato original;

Identificación internaEtiquetaEtiqueta2Etiqueta3Label4Etiqueta5
16017herreroHksserá
12345Perkins
19447Ghtserá
17215PoderComúnAp

Esta es la transformación esperada;

16017herrero
16017Hks
16017será
12345Perkins
19447Ght
19447será
17215Poder
17215Común
17215Ap

Soy capaz de crear una sola columna con todas las etiquetas y soy capaz de crear el ID interno, pero no juntos.

@HBAKER_JGD

Puede hacerlo en Power Query, pegar el código siguiente en una consulta en blanco>Editor avanzado y seguir los sencillos pasos:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQzMDRX0lEKzs0syQDSHt7BQDI8MydHKVYHKG1kbGIKFAhILcrOzCsGshTAGCxnaWIC0uruEQLTApcyNzIEa8svTy0C0s75ubn5eUCGY4BSbCwA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Internal ID" = _t, Label = _t, Label2 = _t, Label3 = _t]),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Internal ID"}, "Attribute", "Value"),
    #"Removed Columns" = Table.RemoveColumns(#"Unpivoted Other Columns",{"Attribute"}),
    #"Filtered Rows" = Table.SelectRows(#"Removed Columns", each ([Value] <> " ")),
    #"Merged Columns" = Table.CombineColumns(#"Filtered Rows",{"Internal ID", "Value"},Combiner.CombineTextByDelimiter("", QuoteStyle.None),"New Column")
in
    #"Merged Columns"

Fowmy_0-1599245955308.png

________________________

Si mi respuesta fue útil, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla

Haga clic en el icono Thumbs-Up si le gusta esta respuesta 🙂

Youtube Linkedin



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Lo sentimos - Mi copia pasta de Excel - Uní las 2 columnas en una. El resultado final debe ser

InternalID ( InternalID) Etiqueta


16017 ? herrero
16017 ? Hks
16017 ? será
12345 Perkins
19447 ? Ght
19447 ? será
17215 Potencia
17215 Común
17215 AP

@HBAKER_JGD

Prueba esto por favor:

Fowmy_0-1599248225706.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQzMDRX0lEKzs0syQDSHt7BQDI8MydHKVYHKG1kbGIKFAhILcrOzCsGshTAGCxnaWIC0uruEQLTApcyNzIEa8svTy0C0s75ubn5eUCGY4BSbCwA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Internal ID" = _t, Label = _t, Label2 = _t, Label3 = _t]),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Internal ID"}, "Attribute", "Value"),
    #"Removed Columns" = Table.RemoveColumns(#"Unpivoted Other Columns",{"Attribute"}),
    #"Filtered Rows" = Table.SelectRows(#"Removed Columns", each ([Value] <> " ")),
    #"Merged Columns" = Table.CombineColumns(#"Filtered Rows",{"Internal ID", "Value"},Combiner.CombineTextByDelimiter("||", QuoteStyle.None),"New Column")
in
    #"Merged Columns"

________________________

Si mi respuesta fue útil, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla

Haga clic en el icono Thumbs-Up si le gusta esta respuesta 🙂

Youtube Linkedin



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Gracias, pero los necesito en 2 columnas separadas

@HBAKER_JGD

Aquí tienes...

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQzMDRX0lEKzs0syQDSHt7BQDI8MydHKVYHKG1kbGIKFAhILcrOzCsGshTAGCxnaWIC0uruEQLTApcyNzIEa8svTy0C0s75ubn5eUCGY4BSbCwA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Internal ID" = _t, Label = _t, Label2 = _t, Label3 = _t]),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Internal ID"}, "Attribute", "Value"),
    #"Removed Columns" = Table.RemoveColumns(#"Unpivoted Other Columns",{"Attribute"}),
    #"Filtered Rows" = Table.SelectRows(#"Removed Columns", each ([Value] <> " "))
in
    #"Filtered Rows"

________________________

Si mi respuesta fue útil, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla

Haga clic en el icono Thumbs-Up si le gusta esta respuesta 🙂

Youtube Linkedin

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

amitchandak
Super User
Super User

@HBAKER_JGD , unión y select columna debe funcionar bien.

Para usar unir todas estas multas con la etiqueta en la nueva tabla. El único estará activo.

Use userelation para crear otra fórmula

https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in...

Anonymous
Not applicable

Gracias @amitchandak por su pronta respuesta!

No estoy seguro de que las relaciones de mesa funcionen, ya que podría haber duplicados en algunos campos.... a menos que me esté perdiendo algo?

Cuando trato de ponerlos juntos estoy recibiendo un error de agruencia demasiado

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors