Forum Discussion

akhaliq7's avatar
akhaliq7
Post Prodigy
4 years ago
Solved

id column type text convert to number (query folding)

I have pulled in a table from a database which makes the id column a text data type automatically. This makes my data load slower than my other tables that have a number as their id column. What would anyone suggest I do leave it as it is, break my query folding as the last step in power query and change the data type to a number or is there anything else I can do?

 

FYI: My queries are also using query folding.

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi akhaliq7 ,

     

    Did you use Power BI Desktop to connect data? Try to select 'Detect column types and headers for unstructured sources according to each file's setting' in the options.

     

    Best Regards,

    Stephen Tao

     

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

7 Replies

  • Hi akhaliq7 ,

     

    No reason why changing this field to a number should break query folding, just make sure to change it to Decimal type, NOT Whole Number type.

     

    Pete

  • When i convert my text column to a decimal number it still breaks my query folding

    When i right click on the changed type step the view native query is greyed out

  • Anonymous's avatar
    Anonymous
    Not applicable

    Instead of using the default type change, try using Table.TransformColumns instead of Table.TransformColumnsTypes.

     

    =Table.TransformColumns(#"Replace Value", {{"Id", Number.From}})

     

    You could also try Int64.From instead of Number.From.

     

    --Nate

    • akhaliq7's avatar
      akhaliq7
      Post Prodigy

      I tried this and it still breaks the query folding. 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi akhaliq7 ,

     

    Did you use Power BI Desktop to connect data? Try to select 'Detect column types and headers for unstructured sources according to each file's setting' in the options.

     

    Best Regards,

    Stephen Tao

     

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