Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
My table as below.
Name Date Value
A 1.1.2021 1
B 1.1.2021 2
A 1.1.2022 4
But I want to dublicate date and cover all months as I mentioned below.
Name Date Value
A 1.1.2021 1
.
.
A 1.12.2021 1
B 1.1.2021 2
.
.
B 1.12.2021 2
A 1.1.2022 4
.
.
A 1.12.2022 4
Is there any way for it?
Thank you for your interest.
Solved! Go to Solution.
@SeckinYilmaz - Easiest way I could think was using Power Query
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTLUN9Q3MjAyBDGVYnWilZxQBY3AgkgqjYBME6XYWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t, Date = _t, Value = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Name", type text}, {"Date", type date}, {"Value", Int64.Type}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Generated Months", each List.Transform({1 ..12}, each Number.From(_))),
#"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Generated Months"),
#"Added Custom1" = Table.AddColumn(#"Expanded Custom", "Created Month", each #date(Date.Year([Date]),[Generated Months],Date.Day([Date]))),
#"Changed Type1" = Table.TransformColumnTypes(#"Added Custom1",{{"Created Month", type date}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed Type1",{"Date", "Generated Months"})
in
#"Removed Columns"
Proud to be a Super User!
@SeckinYilmaz - Easiest way I could think was using Power Query
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUTLUN9Q3MjAyBDGVYnWilZxQBY3AgkgqjYBME6XYWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t, Date = _t, Value = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Name", type text}, {"Date", type date}, {"Value", Int64.Type}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Generated Months", each List.Transform({1 ..12}, each Number.From(_))),
#"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Generated Months"),
#"Added Custom1" = Table.AddColumn(#"Expanded Custom", "Created Month", each #date(Date.Year([Date]),[Generated Months],Date.Day([Date]))),
#"Changed Type1" = Table.TransformColumnTypes(#"Added Custom1",{{"Created Month", type date}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed Type1",{"Date", "Generated Months"})
in
#"Removed Columns"
Proud to be a Super User!
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
91 | |
87 | |
84 | |
67 | |
49 |
User | Count |
---|---|
131 | |
110 | |
96 | |
70 | |
67 |