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
Anonymous
Not applicable

Replace of column names

Hallo,

ich want to rename the colums names in     #"Geänderter Typ1" 

with the colum names of Table "z_dim_Messpunkte_SAP_namen":

This is my code:

 

let

    Quelle = Sql.Databases("idtsv069"),

    DB_QS = Quelle{[Name="DB_QS"]}[Data],

    dbo_v_SAP_ZDIM_MESSPUNKTE = DB_QS{[Schema="dbo",Item="v_SAP_ZDIM_MESSPUNKTE"]}[Data],

   #"Geänderter Typ" = Table.TransformColumnTypes(dbo_v_SAP_ZDIM_MESSPUNKTE,{{"MANDT", Int64.Type}}),

    #"Geänderter Typ1" = Table.TransformColumnTypes(#"Geänderter Typ",{{"MANDT", type text}}),

    #"Rename Columns" =  Table.RenameColumns(#"Geänderter Typ1", List.Zip( { Table.ColumnNames(#"Geänderter Typ1"), Table.ColumnNames(z_dim_Messpunkte_SAP_namen) } ) )

in

    #"Rename Columns"

 

I get the error:

 

FWil_0-1655652881987.png

A "RenameOperatios" is expected. What does that mean?

 

Where is the error?

1 ACCEPTED SOLUTION
Vijay_A_Verma
Super User
Super User

Use this

1. if no. of columns a are more in 2nd table

 

#"Rename Columns" = Table.RenameColumns(#"Geänderter Typ1",List.Zip({Table.ColumnNames(#"Geänderter Typ1"),List.Range(Table.ColumnNames(z_dim_Messpunkte_SAP_namen),0,List.Count(Table.ColumnNames(#"Geänderter Typ1")))}))

2. If no. of columns are more in first table

#"Rename Columns" = Table.RenameColumns(#"Geänderter Typ1",List.Zip({List.Range(Table.ColumnNames(#"Geänderter Typ1"),0,List.Count(Table.ColumnNames(z_dim_Messpunkte_SAP_namen))),Table.ColumnNames(z_dim_Messpunkte_SAP_namen)}))

 

View solution in original post

1 REPLY 1
Vijay_A_Verma
Super User
Super User

Use this

1. if no. of columns a are more in 2nd table

 

#"Rename Columns" = Table.RenameColumns(#"Geänderter Typ1",List.Zip({Table.ColumnNames(#"Geänderter Typ1"),List.Range(Table.ColumnNames(z_dim_Messpunkte_SAP_namen),0,List.Count(Table.ColumnNames(#"Geänderter Typ1")))}))

2. If no. of columns are more in first table

#"Rename Columns" = Table.RenameColumns(#"Geänderter Typ1",List.Zip({List.Range(Table.ColumnNames(#"Geänderter Typ1"),0,List.Count(Table.ColumnNames(z_dim_Messpunkte_SAP_namen))),Table.ColumnNames(z_dim_Messpunkte_SAP_namen)}))

 

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