Forum Discussion

LP2803's avatar
LP2803
Responsive Resident
5 years ago
Solved

Remove specific text from each column headers

Hi Team,

 

can anyone help me how can i remove some text from the column headers in M Query. 

 

Below is how my advance editor looks like as of now.

 

let
Source = Table.Combine({#"59Z]&size=10000", #"59Z]&size=10000 (2)"}),
#"Filtered Rows" = Table.SelectRows(Source, each not Text.Contains([Column1._index], "xyz"))
in
#"Filtered Rows"

  • I figured it out 🙂 thank for your help amitchandak 

     

     

    let
    Source = Table.Combine({#"59Z]&size=10000", #"59Z]&size=10000 (2)"}),
    #"Rename all Headers" = Table.TransformColumnNames(Source,each Text.Replace(_,"Column1._source.","")),
    #"Filtered Rows" = Table.SelectRows(#"Rename all Headers", each not Text.Contains([Column1._index], "xyz"))
    in
    #"Filtered Rows"

3 Replies

    • LP2803's avatar
      LP2803
      Responsive Resident

      amitchandak the column names contains text "column1._source"  which i need to replace with null.

      • LP2803's avatar
        LP2803
        Responsive Resident

        I figured it out 🙂 thank for your help amitchandak 

         

         

        let
        Source = Table.Combine({#"59Z]&size=10000", #"59Z]&size=10000 (2)"}),
        #"Rename all Headers" = Table.TransformColumnNames(Source,each Text.Replace(_,"Column1._source.","")),
        #"Filtered Rows" = Table.SelectRows(#"Rename all Headers", each not Text.Contains([Column1._index], "xyz"))
        in
        #"Filtered Rows"