GPT "Power Query Assistant"
Description
Expert in Power Query and DAX for Power BI, offering in-depth guidance and insights
Conversation Starters
Power Query Folding: “To help you optimize your Power Query script for better performance, I will analyze each transformation step for query folding capabilities. Query folding pushes transformations to the data source, reducing data movement and improving efficiency. I’ll categorize each step into three groups: Will Fold, May Fold, and Won't Fold. Based on the results, I will provide specific recommendations for optimizing non-folding steps, including SQL equivalents where applicable. If some steps cannot fold, I’ll suggest alternatives to ensure maximum performance. Please share your Power Query script so I can begin the analysis. Once received, I will examine each step and provide actionable improvements.”
Power Query Rewrite: “I can help you review and rewrite your Power Query script to ensure it’s optimized for performance and best practices. Please provide the Power Query script you’d like me to analyze, and I’ll go through it step by step, offering suggestions for improvement where necessary. Feel free to share the script with any specific goals or issues you’d like to address.”
Multi-Path Analysis and Refinement: "Review and improve my Power Query code by exploring multiple reasoning paths, evaluating them systematically using quantitative metrics, and selecting the best course of action to optimize Power Query M code. **User Prompt**: ``` You are an expert in Power Query M programming tasked with reviewing, improving, and optimizing Power Query M code. Your goal is to enhance the code's efficiency, readability, and adherence to best practices. Follow these steps: 1. Review the following Power Query M code: <original_code> {{POWER_QUERY_M_CODE}} </original_code> 2. Carefully examine the code and identify any issues, inefficiencies, or areas for improvement. Consider syntax errors, inefficient transformations, and opportunities for query folding. 3. Rewrite the code, addressing the issues you've identified. Focus on correcting syntax errors, enhancing efficiency, and maximizing query folding. Ensure the code follows best practices and optimization techniques. 4. Provide a detailed critique of your rewritten code. Highlight the improvements you've made and any remaining areas for further enhancement. Consider performance improvements, code readability, and compliance with best practices. 5. Based on your critique, write the final version of the Power Query M code. Ensure the code is fully optimized and ready for production use. Double-check for complete error handling, efficient data transformations, and scalability. 6. Present your results in the following format: <review> [Provide your initial review of the original code, highlighting issues and areas for improvement] </review> <rewritten_code> [Insert your rewritten Power Query M code here] </rewritten_code> <critique> [Provide your detailed critique of the rewritten code, including: - Identified Issues: Describe the issues found in the original code. - Rewritten Code: Explain the changes made in the rewritten code. - Further Improvements: Suggest any additional improvements for the final version.] </critique> <final_code> [Insert your final, optimized version of the Power Query M code here] </final_code> Ensure that each section is clearly demarcated with the appropriate XML tags as shown above. ``` **Enhanced ToT Prompt Structure**: 1. **Initial Exploration**: - "Consider the problem presented in the user prompt: 'You are an expert in Power Query M programming tasked with reviewing, improving, and optimizing Power Query M code.' Begin by exploring different potential solutions or reasoning paths that could address the problem. For each path, outline the steps and logic involved. This includes reviewing the syntax, analyzing efficiency, maximizing query folding, enhancing readability, and ensuring compliance with best practices." 2. **Quantitative Evaluation Criteria**: - "Establish a set of evaluation criteria relevant to optimizing Power Query M code. These should include: a) Effectiveness (How well does it improve the code's performance and optimization?) b) Efficiency (How much does it reduce complexity and resource usage?) c) Feasibility (How practical is it to implement the changes?) d) Robustness (How well does it handle edge cases or variations?) e) Readability (How clear and maintainable is the code after changes?) Rate each criterion on a scale of 1-10, where 1 is poor and 10 is excellent." 3. **Path Evaluation**: - "For each reasoning path you have considered, evaluate it using the established criteria. Assign scores for each criterion and calculate a total score. Also, consider qualitative factors such as potential flaws or limitations that might not be captured by the numerical scores." 4. **Iterative Refinement**: - "Based on your evaluation, reconsider any paths that may need refinement. Focus on improving aspects with lower scores. If necessary, backtrack and explore alternative approaches that might yield better results. Continue this process until you have identified the most promising paths." 5. **Final Selection**: - "After thoroughly evaluating all possible reasoning paths, select the one with the highest overall score and best qualitative assessment. Clearly explain why this path is optimal, referencing both the quantitative scores and qualitative evaluations." 6. **Summary of Thought Process**: - "Summarize the reasoning process you followed, including the different paths you explored, how you evaluated them quantitatively and qualitatively, and why the final path was chosen. This summary should provide insight into the decision-making process and how it led to the final optimized version of the Power Query M code." 7. **Final Response**: - "Now, based on the selected optimal path, provide the final answer to the user's prompt, ensuring it directly addresses the original task of optimizing the Power Query M code." --- This enhanced prompt structure helps ensure that the review and optimization of the Power Query M code are thorough, systematic, and aligned with best practices, resulting in highly optimized and maintainable code."
Using Power Query Assistant: “Guidance on Using Power Query Assistant for Power Query and DAX Script Optimization”
The Ultimate Time Saver for ChatGPT & Claude
1-Click Prompts in ChatGPT and Claude for SEO, Marketing, copywriting, and more.
The AIPRM extension adds a list of curated prompt templates for you to ChatGPT and Claude.
Don't miss out on this productivity boost! Use it now for FREE.