Forum Discussion

sarahshh's avatar
sarahshh
Frequent Visitor
1 year ago
Solved

Power Query imports columns in UPPERCASE from Snowflake

Hello,
I’m importing data from Snowflake in Power Query (PowerBI) via a SQL query and I get all columns imported as UPPERCASE although my query specified a mix of lowercase and uppercase (ex: SELECT “My_Column” FROM my_table). How to change this without having to rename them all individually in Power Query?

Thanks!

  • Oh sorry, I thought you meant the values and not the headers.

    For the column headers please use the Advance Editor

     

    add the following line of code to convert all column names to lowercase:

    #"Renamed Columns" = Table.TransformColumnNames(#"Previous Step", Text.Lower)
     
    Did I answer your question? Mark my post as a solution!

     

  • BA_Pete's avatar
    BA_Pete
    1 year ago

    Hi sarahshh ,

     

    MattiaFratello 's solution works for any text transformation so, if by "a mix of lowercase and uppercase" you mean capitalised words with spaces between them, you can use Text.Proper instead of Text.Lower. If your headers are in camel/snake case etc. then yes, unfortunately this won't work for you.

    Note that DAX is case-insensitive when it comes to column names in measures etc. so it shouldn't affect any modeling if you choose to just let the column names pass through to the model as-is from source.

     

    Pete

7 Replies

  • Hi sarahshh ,

     

    I don't think you can.

    IIRC, Impala does exactly the same, it's just the nature of the connector.

     

    Pete

    • sarahshh's avatar
      sarahshh
      Frequent Visitor

      no it doesn't work, it converts the values inside the column, not the names of the columns

      • MattiaFratello's avatar
        MattiaFratello
        Super User

        Oh sorry, I thought you meant the values and not the headers.

        For the column headers please use the Advance Editor

         

        add the following line of code to convert all column names to lowercase:

        #"Renamed Columns" = Table.TransformColumnNames(#"Previous Step", Text.Lower)
         
        Did I answer your question? Mark my post as a solution!