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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
j_gan2022
Frequent Visitor

Data Preparation in Query Editor

Hi, I have a dataset as such

 

There are total 6 columns with ID and Dates for below category:

1. Done

2. Updated

3. Verified

 

Updated and Verified columns can have null value.

Please advise how can i transform into the expected output in Query Editor? Thanks

 

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

 

 

 

Output that I wanted

DateByMode
10/2/2022ACreated
10/2/2022BCreated
10/2/2022CCreated
11/2/2022DCreated
11/2/2022ECreated
11/2/2022FCreated
11/2/2022GCreated
12/2/2022HCreated
13/2/2022FUpdated
13/2/2022GUpdated
13/2/2022MVerified
13/2/2022LUpdated
13/2/2022PVerified
14/2/2022JUpdated
14/2/2022NVerified
14/2/2022KUpdated
15/2/2022OVerified
1 REPLY 1
amitchandak
Super User
Super User

@j_gan2022 , Check this code

 

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"

 

 

Little clean up is required. Add this into a blank query in power query

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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