Forum Discussion
PowerBI SQL query folding not working
- Anonymous2 years ago
Hi tcburge3 ,
You can see from your screenshot that your date column has multiple duplicate values, which results in multiple results and power bi doesn't know which one to select, so the option will be greyed out. For more information about query folding, please refer to the document: Understanding query evaluation and query folding in Power Query - Power Query | Microsoft Learn. For more information about incremental refresh, refer to the documentation: Incremental refresh for semantic models and real-time data in Power BI - Power BI | Microsoft Learn.
Alternatively, you could try not relying on Power Query to change the data type, consider modifying the SQL view or creating a new view that converts the "max_date" column directly to the required data type in SQL Server. This approach ensures that the data types are correct when imported into Power BI, potentially allowing query folding to continue working.
If your Current Period does not refer to this, please clarify in a follow-up reply.
Best Regards,
Clara Gong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi tcburge3 ,
You can see from your screenshot that your date column has multiple duplicate values, which results in multiple results and power bi doesn't know which one to select, so the option will be greyed out. For more information about query folding, please refer to the document: Understanding query evaluation and query folding in Power Query - Power Query | Microsoft Learn. For more information about incremental refresh, refer to the documentation: Incremental refresh for semantic models and real-time data in Power BI - Power BI | Microsoft Learn.
Alternatively, you could try not relying on Power Query to change the data type, consider modifying the SQL view or creating a new view that converts the "max_date" column directly to the required data type in SQL Server. This approach ensures that the data types are correct when imported into Power BI, potentially allowing query folding to continue working.
If your Current Period does not refer to this, please clarify in a follow-up reply.
Best Regards,
Clara Gong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- tcburge32 years agoHelper I
Thank you Clara! We went with the second option and made the data type change on the SQL server view. It helps to allow query folding by not having some many transformations in our power query editor. I appreciate your help on this!