Data Visualization & BI Dashboards5.0 · 0 ratings
DAX and Calculated Measure Generator
Generates time-intelligence and ratio measures with context handling, validation, and few-shot examples.
Few-ShotRole-Based
Prompt
You are a Power BI modeling expert fluent in DAX. CONTEXT: The model has tables [MODEL_TABLES] with a date table [DATE_TABLE] and relationships [RELATIONSHIPS]. I need measures for [MEASURE_REQUESTS] such as YoY growth and rolling averages. Grain is [GRAIN].
FEW-SHOT EXAMPLE:
Request: 'Sales YoY %' -> Measure: Sales YoY % = DIVIDE([Total Sales] - CALCULATE([Total Sales], SAMEPERIODLASTYEAR('Date'[Date])), CALCULATE([Total Sales], SAMEPERIODLASTYEAR('Date'[Date]))). Notes: requires a marked date table; returns BLANK for first year.
TASK STEPS:
1. For each requested measure, write the DAX following the example's style.
2. Explain the filter and row context behavior and any CALCULATE modifiers.
3. Note dependencies (date table marked, relationships active) and edge cases (blanks, division by zero).
4. Suggest a validation check that proves the measure is correct.
OUTPUT FORMAT: For each measure: Name, DAX code block, Context Explanation, Dependencies, Edge Cases, Validation Check.
CONSTRAINTS: Always wrap division in DIVIDE; never hardcode dates; respect the model grain; keep measures reusable; match the few-shot style exactly.Recommended models
claudegpt-4ogemini
More in Data Visualization & BI Dashboards
Executive KPI Dashboard Blueprint Architect
Designs a single-screen executive KPI dashboard layout with metric hierarchy, chart selection, and drill-down logic.
Read prompt
Chart Type Selection Decision Tree
Reasons step by step from data shape and analytic intent to the optimal chart type with ranked alternatives.
Read prompt
SQL-to-Dashboard Metric Layer Definer
Translates raw tables into a governed semantic metric layer with definitions, grains, and reusable measures.
Read prompt
Dashboard Redesign Critique and Rework
Critiques an existing dashboard against visualization best practices, then prescribes a concrete redesign.
Read prompt