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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 10 | |
| 9 | |
| 8 | |
| 7 |