cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Syndicate_Admin
Administrator
Administrator

Cancellation of Dynamization + Copied Columns

Good

I have a table in the query where I have three columns with an information. The following happens to me:

- In these three columns I want to do the "Undo Dynamization of the columns" so that in the same column are all the attributes.

- On the other hand I am also interested in having these three columns separately where each column represents a value of the attribute.

From each case I will draw a different metric. It is necessary to have it in both ways.

What is the most optimal way to work this table to have both options?

The way I have thought is the following (I give you an example):

1. Original table:

YearAfricaHADAmerica
2001567283
2002577384
2003587485

2. Make a copy of the three columns.

YearAfricaHADAmericaAfrica-copyEU-copyingAmerica-copia
2001567283567283
2002577384577384
2003587485587485

3. Make dynamization of the three columns and leave them as they are.

YearAfrica-copyEU-copyingAmerica-copiaAttributeValue
2001567283Africa56
2001567283HAD72
2001567283America83
2002577384Africa57
2002577384HAD73
2002577384America84
2003587485Africa58
2003587485HAD74
2003587485America85

That is, before doing the dynamization make a copy of the three columns to leave them as they were. So I have both forms.

Can the table bring problems like this? Does that make sense? What other option can be proposed?

Another option could be to simply upload the table twice, but it forces me to relate it to the rest of the tables again.

Thanks in advance.

Best regards.

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

Ok. Thanks for the reply. So I will. Best regards.

lbendlin
Super User
Super User

You don't need to do that. Instead, unpivot your data to make it usable for Power BI.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMFTSUTI1AxLmRkDCwlgpVgcsDuKZmoPEjUHiJjBxEM/UAiRuAhI3VYqNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Year = _t, Africa = _t, HAD = _t, America = _t]),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Year"}, "Region", "Value"),
    #"Changed Type" = Table.TransformColumnTypes(#"Unpivoted Other Columns",{{"Year", Int64.Type}, {"Value", Int64.Type}})
in
    #"Changed Type"

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors