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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
ChiRomeu
Helper I
Helper I

Calculated table

Hello colleagues,

  I have a following table which I want convert it to:

  Could you please kindly help me to solve that?

 

Best regards

Chi

ChiRomeu_0-1707770380416.png

 

2 ACCEPTED SOLUTIONS
adudani
Memorable Member
Memorable Member

hi @ChiRomeu ,

 

I used power query for this. 

 

create a blank query, copy and paste the below code into the advanced editor.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMlbSUTI0MjAwANIGhvpABBaM1QHLGgFFjUzQZI2UYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Year = _t, Amount = _t, Date = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Year", Int64.Type}, {"Amount", type number}, {"Date", type date}}),
    //create a list of months
    Month = Table.AddColumn(#"Changed Type", "Month", each {1..12} ),
    //expand the months
    #"Expanded Month" = Table.ExpandListColumn(Month, "Month"),
    //create a date using year and month
    #"Added Custom" = Table.AddColumn(#"Expanded Month", "Date_", each #date([Year],[Month],01)),
    //transform to look like output
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Date"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Removed Columns",{{"Date_", type date}, {"Month", Int64.Type}}),
    #"Renamed Columns" = Table.RenameColumns(#"Changed Type1",{{"Date_", "Date"}})
in
    #"Renamed Columns"

 

let me know if this works for you.

 

thanks.

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a Kudos 🙂
Kind Regards,
Avinash

View solution in original post

Hi @ChiRomeu ,

Kindly add a column after the month lost step.

Use [amount] / List.Count([Month] in the step and then expand the month list.

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a Kudos 🙂
Kind Regards,
Avinash

View solution in original post

3 REPLIES 3
adudani
Memorable Member
Memorable Member

hi @ChiRomeu ,

 

I used power query for this. 

 

create a blank query, copy and paste the below code into the advanced editor.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMlbSUTI0MjAwANIGhvpABBaM1QHLGgFFjUzQZI2UYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Year = _t, Amount = _t, Date = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Year", Int64.Type}, {"Amount", type number}, {"Date", type date}}),
    //create a list of months
    Month = Table.AddColumn(#"Changed Type", "Month", each {1..12} ),
    //expand the months
    #"Expanded Month" = Table.ExpandListColumn(Month, "Month"),
    //create a date using year and month
    #"Added Custom" = Table.AddColumn(#"Expanded Month", "Date_", each #date([Year],[Month],01)),
    //transform to look like output
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Date"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Removed Columns",{{"Date_", type date}, {"Month", Int64.Type}}),
    #"Renamed Columns" = Table.RenameColumns(#"Changed Type1",{{"Date_", "Date"}})
in
    #"Renamed Columns"

 

let me know if this works for you.

 

thanks.

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a Kudos 🙂
Kind Regards,
Avinash

Dear Avinash,

 It works a half until expanded column "month", but as you can see the picture above, i want to something like when expanded to month meanwhile divided by 12 for the amount column.

 

Thanks

Chi

Hi @ChiRomeu ,

Kindly add a column after the month lost step.

Use [amount] / List.Count([Month] in the step and then expand the month list.

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a Kudos 🙂
Kind Regards,
Avinash

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.