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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
akarca
Frequent Visitor

Create table from another table

Hello, I have a table below. I would like to sum monthly volume base and create a new table with the horizontal month columns.

 

ProductVolume(kg)Date
A96.01.2022
A1091,9755.02.2022
B14095.01.2022
C10964,162.02.2022
D3032,645.01.2022
B12130,565.01.2022
C12597,126.01.2022
D466,566.03.2022
A1382,46.04.2022
C2822,46.08.2022
A637220.10.2022
D280820.09.2022
A3893,7620.11.2022
B1290,245.11.2022
B1612,85.11.2022

 

 

Ekran görüntüsü 2023-01-16 104236.jpg

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @akarca ,

I have created a simple sample, please refer to my pbix fiel to see if it helps you.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("bY8xDsIwDEXvkgkkS7GdxElGoAdgYqk6IEAMgCqh9v4kLW1DxeDBfnrfdl2r47u99pdOgTq1z/512zzu29RU5+6mGqjVLjUxFSOzJi3zkDASRO8mxtoNbJ+ZxcIZ54fREQski8MDq9LAoGEQu9aGOCaD4ORvJLvogXh9Yo60IoVlyuNNYJh32S/JeRy4IKFwxPhlC2rGeQ8HDBOJE8iKCdGAX+6mCY5fRQS2BSw+FmIIv6j5AA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"(blank)" = _t, #"(blank).1" = _t, #"(blank).2" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"(blank)", type text}, {"(blank).1", type text}, {"(blank).2", type text}}),
    #"Promoted Headers" = Table.PromoteHeaders(#"Changed Type", [PromoteAllScalars=true]),
    #"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"Product", type text}, {"Volume(kg)", Int64.Type}, {"Date", type date}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type1", "Custom", each Date.MonthName([Date])),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Date"}),
    #"Pivoted Column" = Table.Pivot(#"Removed Columns", List.Distinct(#"Removed Columns"[Custom]), "Custom", "Volume(kg)", List.Sum)
in
    #"Pivoted Column"

vpollymsft_0-1673922253797.png

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Polly

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @akarca ,

I have created a simple sample, please refer to my pbix fiel to see if it helps you.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("bY8xDsIwDEXvkgkkS7GdxElGoAdgYqk6IEAMgCqh9v4kLW1DxeDBfnrfdl2r47u99pdOgTq1z/512zzu29RU5+6mGqjVLjUxFSOzJi3zkDASRO8mxtoNbJ+ZxcIZ54fREQski8MDq9LAoGEQu9aGOCaD4ORvJLvogXh9Yo60IoVlyuNNYJh32S/JeRy4IKFwxPhlC2rGeQ8HDBOJE8iKCdGAX+6mCY5fRQS2BSw+FmIIv6j5AA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"(blank)" = _t, #"(blank).1" = _t, #"(blank).2" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"(blank)", type text}, {"(blank).1", type text}, {"(blank).2", type text}}),
    #"Promoted Headers" = Table.PromoteHeaders(#"Changed Type", [PromoteAllScalars=true]),
    #"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"Product", type text}, {"Volume(kg)", Int64.Type}, {"Date", type date}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type1", "Custom", each Date.MonthName([Date])),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Date"}),
    #"Pivoted Column" = Table.Pivot(#"Removed Columns", List.Distinct(#"Removed Columns"[Custom]), "Custom", "Volume(kg)", List.Sum)
in
    #"Pivoted Column"

vpollymsft_0-1673922253797.png

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Polly

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

akarca
Frequent Visitor

Hello @Samarth_18 , because I will use these tables columns in other tables. Also, I will create different columns like this. 

Samarth_18
Community Champion
Community Champion

Hi @akarca ,

 

Do you really need a seperate table since you can achieve this using Matrix Visual  by keeping the column as below:-

Samarth_18_0-1673859989386.png

 

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.

Top Solution Authors
Top Kudoed Authors