Modern Business Analysis has evolved beyond simple requirements gathering; it now demands high-level technical proficiency in data manipulation and visualization. AI has fundamentally shifted how analysts interact with data, turning hours of coding and troubleshooting into minutes of strategic refinement.
The following prompts have been rigorously tested and optimized for ChatGPT, Gemini, Claude, and DeepSeek. While each model possesses distinct architectures—DeepSeek often excelling at pure code logic and Claude at semantic understanding—these 10 prompts provide a universal, high-performance foundation for any Business Analyst looking to leverage SQL, Tableau, and Power BI effectively.
1. Complex SQL Query Generation from Natural Language
Best for: DeepSeek (for logic precision) or ChatGPT (for versatility).
Writing multi-join queries with window functions can be error-prone. This prompt forces the AI to construct syntactically correct SQL based on plain English business logic.
Act as a Senior Data Engineer. I need a standard SQL query compatible with [PostgreSQL/SQL Server/MySQL].
My database schema has three tables:
1. 'Orders' (OrderID, CustomerID, OrderDate, TotalAmount)
2. 'Customers' (CustomerID, Region, SignupDate)
3. 'Returns' (ReturnID, OrderID, ReturnReason)
Write a query to calculate the 'Return Rate' (percentage of orders returned) per Region for the last trailing 12 months. Include a CTE to handle the date filtering first. Output the code with comments explaining the logic.
The Payoff: Eliminates syntax errors in complex joins and ensures date logic is handled efficiently via Common Table Expressions (CTEs).
2. Optimizing Slow SQL Queries
Best for: DeepSeek (for code efficiency).
When queries hang or consume excessive resources, you need an optimization partner to identify bottlenecks without rewriting the entire logic manually.
Review the following SQL query for performance optimization. Identify specific inefficiencies such as unnecessary subqueries, non-SARGable predicates, or inefficient joins.
[INSERT YOUR SLOW SQL QUERY HERE]
Provide the optimized version of the code and explain exactly which changes reduced the computational cost.
The Payoff: Instantly identifies hidden performance killers, reducing query runtimes and server load.
3. Creating Complex DAX Time Intelligence Measures
Best for: ChatGPT (standard industry knowledge) or Claude (contextual explanation).
Time Intelligence in Power BI (e.g., Year-over-Year growth comparisons) often requires tricky filter context manipulation.
Act as a Power BI Expert. I need a DAX measure to calculate 'Year-over-Year (YoY) Sales Growth %'.
- Fact Table: 'Sales_Data'
- Date Table: 'Date_Table' (linked on Date key)
- Measure: [Total Sales]
The DAX must handle potential division by zero errors and ensure it respects the external filter context of the visual. Provide the code for [YoY Sales Growth %] and the supporting [Sales Last Year] measure.
The Payoff: Generates production-ready DAX that robustly handles edge cases like missing data or division errors.
4. Designing Tableau Level of Detail (LOD) Expressions
Best for: Claude (nuance) or Gemini (logic).
LOD expressions (FIXED, INCLUDE, EXCLUDE) are powerful but syntactically unforgiving. This prompt helps you bypass the trial-and-error phase.
I am working in Tableau and need a FIXED Level of Detail (LOD) expression.
I want to calculate the 'Average Order Value per Customer' regardless of the dimensions currently in the view (e.g., Region or Category).
- Dimension: [Customer Name]
- Measure: [Sales]
Write the calculated field formula. Then, explain how this calculation will behave if I filter by 'Region' versus if I filter by 'Order Date' (context filters).
The Payoff: Clarifies the interaction between the calculation and view filters, preventing common aggregation errors in reporting.
5. Translating Business Logic into Database Schema
Best for: Claude (excellent at parsing business intent).
Before writing code, analysts often need to structure data models. This prompt converts abstract requirements into a tangible schema design.
Act as a Data Architect. I have a requirement to track a subscription service for a SaaS product.
We need to track:
- Users (who can have multiple subscriptions)
- Subscription Plans (Tier 1, Tier 2)
- Billing Cycles (Monthly, Yearly)
- Payment History
Propose a Star Schema design (Fact and Dimension tables) for this requirement. List the Primary Keys and Foreign Keys for each table.
The Payoff: Provides a blueprint for data modeling that ensures scalability and accurate reporting relationships in Power BI or Tableau.
6. Debugging “M” Code in Power Query
Best for: DeepSeek (technical debugging) or ChatGPT.
Power Query’s “M” language is case-sensitive and notoriously difficult to debug for syntax errors.
I am receiving an 'Expression.Error' in Power Query Editor with the following M code script.
[INSERT M CODE SNIPPET]
The goal is to unpivot columns A, B, and C while keeping column 'ID' fixed. Diagnose the syntax error or logical flaw and provide the corrected script.
The Payoff: Saves hours of frustration by pinpointing exact syntax faults in the data transformation layer.
7. Automating Data Dictionary Creation
Best for: Gemini (handling large text inputs) or Claude.
Documentation is critical but tedious. Use AI to generate clear definitions for your stakeholders.
Below is a list of SQL column names and their data types from our 'Inventory_Snapshot' table.
[INSERT COLUMN LIST: e.g., SKU, Qty_OH, Reorder_Lvl, Last_Audit_Date]
Generate a user-friendly Data Dictionary for business stakeholders. For each column, provide a clear, non-technical definition of what the data represents and how it should be used in analysis.
The Payoff: Bridges the gap between technical data structures and business understanding, ensuring stakeholders interpret reports correctly.
8. Generating Regex for Data Cleaning
Best for: DeepSeek or ChatGPT.
Cleaning messy strings (like extracting email domains or formatting phone numbers) in SQL or Python/Pandas requires precise Regular Expressions.
I need a Regular Expression (Regex) pattern to use in a SQL function (or Python).
The target data contains strings like:
"ID: 4522 - LOC: NY - Date: 2023/05"
"ID: 9981 - LOC: CA - Date: 2024/01"
Write a Regex pattern to extract only the Location code (e.g., 'NY', 'CA'). Explain how the pattern identifies the correct substring.
The Payoff: specific, complex text extraction logic that is instantly testable and deployable.
9. Strategic Dashboard Layout & KPI Selection
Best for: Claude (design and strategy).
Sometimes the challenge isn’t the code, but the visual storytelling.
Act as a Data Visualization Specialist. I am building an executive dashboard for a CFO regarding 'Operational OpEx'.
Suggest the top 5 KPIs I should display at the top. For each KPI, recommend the specific visualization type (e.g., BAN, Sparkline, Bullet Chart) that best communicates the trend versus the budget. Explain the psychological reasoning for your layout choice.
The Payoff: elevated dashboard design that focuses on decision-making rather than just displaying raw data.
10. Converting Excel Logic to SQL/DAX
Best for: ChatGPT (versatile translation).
Analysts often inherit massive Excel files that need to be migrated to a robust database or BI tool.
I have a complex Excel formula that I need to convert into [SQL Case Statement / Power BI DAX].
Excel Formula:
=IF(AND(A2>1000, B2="Premium"), "High Priority", IF(A2>500, "Medium", "Low"))
Translate this logic into the target language, ensuring it handles null values appropriately.
The Payoff: seamless migration of legacy business logic into scalable enterprise systems.
Pro-Tip: The “Context-First” Chain
To get elite results, do not just copy-paste the prompt. Use Prompt Chaining. First, paste your schema or data sample (anonymized) and ask the AI to “Analyze this structure and confirm you understand the relationships.” Only after the AI confirms understanding should you issue the specific task prompt. This primes the model’s context window for significantly higher accuracy.
By mastering these inputs, you transition from a technician who writes code to a strategist who architects solutions. Integrating these prompts into your daily workflow will not only accelerate your output but also standardize the quality of your insights across SQL, Tableau, and Power BI.
