Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
JS
Helper II
Helper II

Data transformation help

Hello all experts. 

 

I have the data below 

 

1/1/20182424000

 

I would like to transform it into 

 

Start DateAmount
1/1/20181000
2/1/20181000
3/1/20181000
4/1/20181000
5/1/20181000
6/1/20181000
7/1/20181000
8/1/20181000
9/1/20181000
10/1/20181000
11/1/20181000
12/1/20181000
1/1/20191000
2/1/20191000
3/1/20191000
4/1/20191000
5/1/20191000
6/1/20191000
7/1/20191000
8/1/20191000
9/1/20191000
10/1/20191000
11/1/20191000
12/1/20191000

 

Is there anyway that this can be achieved? 

 

Thanks!

JS

1 ACCEPTED SOLUTION
donsvensen
Continued Contributor
Continued Contributor

Hi JS,

 

You can do that like this

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMtQ11DUyMLRQ0lEyMgETBgYGSrGxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type date}, {"Column2", Int64.Type}, {"Column3", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "List", each List.Range({0..[Column2]},1)),
    #"Expanded List" = Table.ExpandListColumn(#"Added Custom", "List"),
    #"Added Custom1" = Table.AddColumn(#"Expanded List", "Custom", each [Column3]/[Column2]),
    #"Added Custom2" = Table.AddColumn(#"Added Custom1", "Custom.1", each Date.AddMonths([Column1], [List]-1))
in
    #"Added Custom2"

The Source is just the table I have create to hold the data example

 

/Erik

View solution in original post

1 REPLY 1
donsvensen
Continued Contributor
Continued Contributor

Hi JS,

 

You can do that like this

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMtQ11DUyMLRQ0lEyMgETBgYGSrGxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type date}, {"Column2", Int64.Type}, {"Column3", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "List", each List.Range({0..[Column2]},1)),
    #"Expanded List" = Table.ExpandListColumn(#"Added Custom", "List"),
    #"Added Custom1" = Table.AddColumn(#"Expanded List", "Custom", each [Column3]/[Column2]),
    #"Added Custom2" = Table.AddColumn(#"Added Custom1", "Custom.1", each Date.AddMonths([Column1], [List]-1))
in
    #"Added Custom2"

The Source is just the table I have create to hold the data example

 

/Erik

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.