Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello everyone, i am trying to unpivot data. see below image. this is my dataAnd expected result is
can anyone help me
Solved! Go to Solution.
i have resolver by my self. using custom code, i have achive this.
let
Source = Excel.Workbook(File.Contents("....test pivot.xlsx"), null, true),
Table1_Table = Source{[Item="Table1",Kind="Table"]}[Data],
#"Added Custom" = Table.AddColumn(Table1_Table, "Custom", each
#table(
type table [Module=text, Date=number, Time=text, Time1=text],
{
{ "Mod", [Mod], "Time", [Time] },
{ "abc", [abc], "Time2", [Time2] },
{ "bsd", [bsd], "Time3", [Time3] },
{ "sdf", [sdf], "Time4", [Time4] },
{ "aert", [aert], "Time5", [Time5] },
{ "hwh", [hwh], "Time6", [Time6] },
{ "qgqsdg", [qgqsdg], "Time7", [Time7] },
{ "eyyr", [eyyr], "Time8", [Time8] },
{ "qsxddt", [qsxddt], "Time9", [Time9] },
{ "jkhktr", [jkhktr], "Time10", [Time10] }
}
), type table
),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Mod", "Time", "abc", "Time2", "bsd", "Time3", "sdf", "Time4", "aert", "Time5", "hwh", "Time6", "qgqsdg", "Time7", "eyyr", "Time8", "qsxddt", "Time9", "jkhktr", "Time10"}),
#"Expanded Custom" = Table.ExpandTableColumn(#"Removed Columns", "Custom", {"Module", "Date", "Time", "Time1"}, {"Module", "Date", "Time", "Time1"}),
#"Filtered Rows" = Table.SelectRows(#"Expanded Custom", each [Date] <> null and [Date] <> ""),
#"Changed Type" = Table.TransformColumnTypes(#"Filtered Rows",{{"Date", type date}})
in
#"Changed Type"
i have resolver by my self. using custom code, i have achive this.
let
Source = Excel.Workbook(File.Contents("....test pivot.xlsx"), null, true),
Table1_Table = Source{[Item="Table1",Kind="Table"]}[Data],
#"Added Custom" = Table.AddColumn(Table1_Table, "Custom", each
#table(
type table [Module=text, Date=number, Time=text, Time1=text],
{
{ "Mod", [Mod], "Time", [Time] },
{ "abc", [abc], "Time2", [Time2] },
{ "bsd", [bsd], "Time3", [Time3] },
{ "sdf", [sdf], "Time4", [Time4] },
{ "aert", [aert], "Time5", [Time5] },
{ "hwh", [hwh], "Time6", [Time6] },
{ "qgqsdg", [qgqsdg], "Time7", [Time7] },
{ "eyyr", [eyyr], "Time8", [Time8] },
{ "qsxddt", [qsxddt], "Time9", [Time9] },
{ "jkhktr", [jkhktr], "Time10", [Time10] }
}
), type table
),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Mod", "Time", "abc", "Time2", "bsd", "Time3", "sdf", "Time4", "aert", "Time5", "hwh", "Time6", "qgqsdg", "Time7", "eyyr", "Time8", "qsxddt", "Time9", "jkhktr", "Time10"}),
#"Expanded Custom" = Table.ExpandTableColumn(#"Removed Columns", "Custom", {"Module", "Date", "Time", "Time1"}, {"Module", "Date", "Time", "Time1"}),
#"Filtered Rows" = Table.SelectRows(#"Expanded Custom", each [Date] <> null and [Date] <> ""),
#"Changed Type" = Table.TransformColumnTypes(#"Filtered Rows",{{"Date", type date}})
in
#"Changed Type"
Hi @Anonymous
Can you please paste a sample of the table (including all relevant columns) here in text-tabular format, so that it can be copied and worked on (instead of on a screen capture)
Please mark the question solved when done and consider giving kudos if posts are helpful.
Contact me privately for support with any larger-scale BI needs
Cheers
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.