Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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.
Solved! Go to Solution.
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.
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.
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
I tried this and it still breaks the query folding.
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
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
Proud to be a Datanaut!
Hi @BA_Pete
Could you please explain why we shouldn't change it to a Whole Number type ?
Thanks
Because Int64.Type isn't recognised by SQL Server for query folding unless you use the [UnsafeTypeConversions = true] argument. As this suggests, it's potentially unsafe and, therefore, not a recommendation I'd generally make to users on here.
If it's something you really want/need to do, then I'd suggest reading Chris Webb's methods here, and understand the risks:
Pete
Proud to be a Datanaut!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
17 | |
10 | |
8 | |
8 | |
7 |