cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AmandaF
New Member

New table for other table

I Have a dataframe like this

AmandaF_1-1683047825287.png

 

I would like to create a new table transforming the months columns (April and may) in just one column like this. Because the sum of the payment column by column A must stay as it is in first dateframe, (If I create a sum metric, it returns  1299 for A30FF)

AmandaF_2-1683048109300.png

 

 

 

 

1 REPLY 1
sendilc
Frequent Visitor

Hi, 

Pls check the below solution.. 

 

 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcjQ2cHNT0lEyNLK0BFKWBgZA0hjIjtUBShoaufkA+aYGYGEjUwQFljYxdXMHaQJrNYCyYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [OrderNo = _t, Payment = _t, April = _t, May = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Payment", Int64.Type}, {"April", Int64.Type}, {"May", Int64.Type}}),
#"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"OrderNo", "Payment"}, "Month", "Value")
in
#"Unpivoted Columns"

 

Regards

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Top Solution Authors
Top Kudoed Authors