Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Dear Community,
can anyone help me, with the transformation below?
I Think it should be possible without programming a loop...
Here is an Example file
Many thanks an regards,
Michael
Solved! Go to Solution.
M Code from Advanced Editor
let
Source = Excel.CurrentWorkbook(){[Name="Table3"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{
{"ProductFamily", type text}, {"From", type date}, {"To", type date}, {"ID", type text}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Date",
each List.Dates([From],Duration.Days([To]-[From])+1,#duration(1,0,0,0))),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"From", "To"}),
#"Reordered Columns" = Table.ReorderColumns(#"Removed Columns",{"ProductFamily", "Date", "ID"}),
#"Expanded Date" = Table.ExpandListColumn(#"Reordered Columns", "Date"),
#"Changed Type1" = Table.TransformColumnTypes(#"Expanded Date",{{"Date", type date}})
in
#"Changed Type1"
M Code from Advanced Editor
let
Source = Excel.CurrentWorkbook(){[Name="Table3"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{
{"ProductFamily", type text}, {"From", type date}, {"To", type date}, {"ID", type text}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Date",
each List.Dates([From],Duration.Days([To]-[From])+1,#duration(1,0,0,0))),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"From", "To"}),
#"Reordered Columns" = Table.ReorderColumns(#"Removed Columns",{"ProductFamily", "Date", "ID"}),
#"Expanded Date" = Table.ExpandListColumn(#"Reordered Columns", "Date"),
#"Changed Type1" = Table.TransformColumnTypes(#"Expanded Date",{{"Date", type date}})
in
#"Changed Type1"
Really cool and so easy! Thank you very much!