Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 7 | |
| 7 | |
| 5 | |
| 4 | |
| 3 |
| User | Count |
|---|---|
| 14 | |
| 14 | |
| 10 | |
| 8 | |
| 8 |