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

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.

Reply
gauravnarchal
Post Prodigy
Post Prodigy

Columnas coincidentes en 2 tablas

Estimados Todos

Necesito tu ayuda.

Tengo dos mesas como abajo. En la tabla 1 tengo los datos y en la tabla 2 el personal actualiza toda la información.

Requisito

  1. En la Tabla 2, identifique el primer carácter de coloumn "Identificador" de cada fila.
  2. Ahora coincide con la columna de código y el primer carácter de la columna "Identificador" en la tabla 2 con el código y la categoría de la tabla 1.

Retorno / Resultado

  1. Columna de envío de la Tabla 1.

¿Puede sugerir si puedo hacer esto a través de Medir y agregando la Columna?

Gracias

Gaurav

Tabla 1

CódigoCategoríaEnvío
SkQEstándar
WfHEstándar
WfAExpress
WfUExpress
AwBExpress
AwKExpress
AwBExpress
AwLUrgente
AwFUrgente
AwLUrgente
F3YUrgente
F3GUrgente
AhYEstándar
AhYEstándar
UkDExpress
UkHExpress
GqWUrgente
GqOUrgente
GqDEstándar

Tabla 2

CódigoCategoríaIdentificador
SkQQDKRTM
WfHHNOOWM
WfAUNOOWM
WfUUNOOWM
AwBBRTD
AwKBRTD
AwBBRTD
AwLBRTD
AwFLRTD
AwLLRTD
F3YY
F3GMrt
AhYY
AhYY
UkDHL1PYS/YS
UkHHL1PYS/YS
GqWDHSMRTOW
GqODHSMRTOW
GqDDHSMRTOW
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@gauravnarchal ,

nueva columna en la tabla 2o maxx(filter( Table1, Table2[Code] á Table1[Code] && Table1[Category] á left(Table2[Identifier],1)),Table1[Shipping])

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@gauravnarchal ,

nueva columna en la tabla 2o maxx(filter( Table1, Table2[Code] á Table1[Code] && Table1[Category] á left(Table2[Identifier],1)),Table1[Shipping])

Gracias @amitchandak

FrankAT
Community Champion
Community Champion

Hola @gauravnarchal

eche un vistazo al siguiente código M:

// Table2
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("bdDdCoMgGAbge/E4GGNX0JJyWHNLRUQ6GGSjkwXRye5+39cgZ+7gBd/HH1TnSDH1nmSkeCz+Oc1vGF56/1rGYfQz6TJHJAe7YyhvVbOaKaEzzFUI82M5RO9Mx5Yb6GdMq2gQnki6pk4Ez6+TNZuUJ2h2zVYrSNOq7w4Wze+qxjtRfGV9vFl5sDIwS7jCP8IbUCbhfGGCir9KI+0+", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t]),
    #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
    #"Extracted First Characters" = Table.TransformColumns(#"Promoted Headers", {{"Identifier", each Text.Start(_, 1), type text}})
in
    #"Extracted First Characters"

// Table1
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCvZW0lEKBOLgksS8lMSiFKVYnWilcDegiAdWUUcgdq0oKEotLkYIhqIJOoYDBZywCXoTrdIHZG5RempeCULMDYsYmjo3YyA/EouYO5peD6g6FC9iFw0FudoFzZFgQQ80QXdQUIaj2gQW88ci5oJiTywA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Code = _t, Category = _t, Shipping = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Code", type text}, {"Category", type text}, {"Shipping", type text}})
in
    #"Changed Type"

// Merge1
let
    Source = Table.NestedJoin(Table2, {"Code", "Identifier"}, Table1, {"Code", "Category"}, "Table1", JoinKind.LeftOuter),
    #"Expanded Table1" = Table.ExpandTableColumn(Source, "Table1", {"Shipping"}, {"Shipping"})
in
    #"Expanded Table1"

14-09-_2020_00-16-58.png

Con saludos amables desde la ciudad donde la leyenda del 'Pied Piper de Hamelin' está en casa
FrankAT (Orgulloso de ser un Datanaut)

Anonymous
Not applicable

Paso 1crear una columna de cálculo
Dax
CodeCom[Código] &"" &[Categoría]

Step2. crear otra columna calculada

Dax
CodeCom2[Código] &""& IZQUIERDA([IENTIFIER,1)


y hacer una relación entre estas tablas usando la nueva columna CodeCom y CodeCom2

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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