Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext 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
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_BY | Done_Date | Updated_by | Update_Date | Verified_by | Verified_Date |
| A | 10/2/2022 | F | 13/2/2022 | M | 13/2/2022 |
| B | 10/2/2022 | G | 13/2/2022 | ||
| C | 10/2/2022 | N | 14/2/2022 | ||
| D | 11/2/2022 | ||||
| E | 11/2/2022 | J | 14/2/2022 | ||
| F | 11/2/2022 | K | 14/2/2022 | O | 15/2/2022 |
| G | 11/2/2022 | ||||
| H | 12/2/2022 | L | 13/2/2022 | P | 13/2/2022 |
Output that I wanted
| Date | By | Mode |
| 10/2/2022 | A | Created |
| 10/2/2022 | B | Created |
| 10/2/2022 | C | Created |
| 11/2/2022 | D | Created |
| 11/2/2022 | E | Created |
| 11/2/2022 | F | Created |
| 11/2/2022 | G | Created |
| 12/2/2022 | H | Created |
| 13/2/2022 | F | Updated |
| 13/2/2022 | G | Updated |
| 13/2/2022 | M | Verified |
| 13/2/2022 | L | Updated |
| 13/2/2022 | P | Verified |
| 14/2/2022 | J | Updated |
| 14/2/2022 | N | Verified |
| 14/2/2022 | K | Updated |
| 15/2/2022 | O | Verified |
@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
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 50 | |
| 44 | |
| 42 | |
| 18 | |
| 18 |
| User | Count |
|---|---|
| 69 | |
| 68 | |
| 32 | |
| 32 | |
| 32 |