Reply
Syndicate_Admin
Administrator
Administrator
Syndicated - Inbound

Preparación de datos en el Editor de consultas

Source Community: Power BI | Source Author Name: j_gan2022

Hola, tengo un conjunto de datos como tal

Hay un total de 6 columnas con ID y fechas para la siguiente categoría:

1. Hecho

2. Actualizado

3. Verificado

Las columnas Actualizadas y Verificadas pueden tener un valor nulo.

Por favor, aconseje cómo puedo transformar en el resultado esperado en el Editor de consultas? Gracias

Done_BYDone_DateUpdated_byUpdate_DateVerified_byVerified_Date
A10/2/2022F13/2/2022M13/2/2022
B10/2/2022G13/2/2022
C10/2/2022 N14/2/2022
D11/2/2022
E11/2/2022J14/2/2022
F11/2/2022K14/2/2022O15/2/2022
G11/2/2022
H12/2/2022L13/2/2022P13/2/2022

Salida que quería

FechaPorModo
10/2/2022ACreado
10/2/2022BCreado
10/2/2022CCreado
11/2/2022DCreado
11/2/2022ECreado
11/2/2022FCreado
11/2/2022GCreado
12/2/2022HCreado
13/2/2022FActualizado
13/2/2022GActualizado
13/2/2022MVerificado
13/2/2022LActualizado
13/2/2022PVerificado
14/2/2022JActualizado
14/2/2022NVerificado
14/2/2022KActualizado
15/2/2022OVerificado
1 REPLY 1
Syndicate_Admin
Administrator
Administrator

Source Community: Power BI | Source Author Name: amitchandak
Syndicated - Inbound

@j_gan2022 , Compruebe este código

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTI00DfSNzIwMgKy3UB8YwTfF4UfqxOt5ISmwx1NhwIYg1Q6o6lUgGI/kLgJspkuIBFDTJUIs1zRVHihmIGs0g1NpTeaSn8Q3xTZdneCtnuAVBghVPig+TkANZRiAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Done_BY = _t, Done_Date = _t, Updated_by = _t, Update_Date = _t, Verified_by = _t, Verified_Date = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Done_BY", type text}, {"Done_Date", type date}, {"Updated_by", type text}, {"Update_Date", type text}, {"Verified_by", type text}, {"Verified_Date", type text}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Done_BY"}, "Attribute", "Value"),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Unpivoted Columns", "Attribute", Splitter.SplitTextByDelimiter("_", QuoteStyle.Csv), {"Attribute.1", "Attribute.2"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Attribute.1", type text}, {"Attribute.2", type text}}),
    #"Pivoted Column" = Table.Pivot(#"Changed Type1", List.Distinct(#"Changed Type1"[Attribute.2]), "Attribute.2", "Value", List.Max)
in
    #"Pivoted Column"

Se requiere poca limpieza. Agregar esto a una consulta en blanco en power query

avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)