Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote 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!
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 14 | |
| 11 | |
| 8 | |
| 7 | |
| 6 |