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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Manuel123
Helper I
Helper I

Replace Text in all columns but first one (unknown number of columns)

Dear Helpers,

 

I had to change the Type of all columns but the first one with an unknown number of columns and solved it with the following code:

 

#"Übrige Spalten in Zahlen formatieren" = Table.TransformColumnTypes(
        #"Werte ersetzt",
        List.Transform(
            List.RemoveFirstN(
                Table.ColumnNames(#"Werte ersetzt"),
                1
            ),
            each {_,type number}
        )
    )

 

Now I have to replace "." by "," in all columns but the first column and tried it with the following code:

 

 

#"Werte ersetzt" = Table.ReplaceValue(
        #"Datumsspalte umbenennen",
        ".",
        ",",
        Replacer.ReplaceText,
        List.Transform(
            List.RemoveFirstN(
                Table.ColumnNames(#"Datumsspalte umbenennen"),
                1
            )
        )
        ),

 

 

However, I only receive an Error that I have to input 2 arguments and only input 1. Can you help me?

 

BR

Manuel

3 REPLIES 3
Anonymous
Not applicable

Hi @Manuel123 

In Power Query , use “Shift” to choose all the columns except the first one , then right click to select Replace Values to replace “.” by “,” .With “Shift” , you only need to select the first column and the last column, all the columns will be included in it .

Ailsamsft_0-1630310317707.png

Best Regards

Community Support Team _ Ailsa Tao

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

amitchandak
Super User
Super User

@Manuel123 , Have you tried right click on the column and replace. That will generate correct code

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Dear @amitchandak ,

 

sure, however I only see the code for one column. The file will always have an unkown number of columns, thus I wanted to replace the column name by a code that says: Replace in each column but the first one.

 

BR
Manuel

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.