Sintra AI
Home
Live Feed
Automation Hub
Prompt Library256
AI News554
Weekly Digest
Topic Hubs
AI History
AI Labs
Research
Learning Paths
Guides
Resources
Concepts
Videos
AI Tools74
Models
Claude
Google AI
Cost Calc
Back to Sintra/Data & Analytics
intermediate·Data & Analytics·20 min

Auto-Generate DAX Measures from Plain English

A production-ready DAX measure in VAR/RETURN style, plain-English explanations of every function, edge-case warnings, and a simplified version.

⬡
Recommended modelClaude Sonnet 4.6

Handles complex queries across large datasets

What you need to fill in

[describe the calculation in plain English][fact table name and key columns][date table name and whether it is marked as a date table][related dimension tables][existing base measures to reference]

Tools used

Claude SonnetPower BI DesktopPower BI Copilot

The prompt

"I need a DAX measure for Power BI. Here is what I want it to calculate in plain English: [Describe the calculation, e.g. 'Year-to-date revenue compared to the same period last year, expressed as a % change'] Data model context: - Fact table: [name + key columns] - Date table: [name + date column, is it marked as a date table? yes/no] - Related dimensions: [e.g. Customer, Product, Region tables] - Existing base measures I can reference: [list, e.g. [Total Revenue], [Units Sold]] Please: 1. Write the DAX measure using VAR/RETURN style 2. Explain each function in one plain-English sentence 3. Flag any edge cases (blanks, missing periods, filter context issues) 4. Provide a simplified version for a less experienced colleague"
Open in Claude

Sample output

**Production measure:** ```dax Revenue YoY % = VAR _Curr = [Total Revenue] VAR _Prev = CALCULATE([Total Revenue], SAMEPERIODLASTYEAR('Date'[Date])) RETURN DIVIDE(_Curr - _Prev, _Prev, BLANK()) ``` **Function explanations:** - `CALCULATE` — re-evaluates a measure under a modified filter context - `SAMEPERIODLASTYEAR` — shifts the date filter back exactly 12 months - `DIVIDE` — safe division that returns BLANK() instead of an error when the denominator is zero **Edge cases:** - Returns BLANK() for periods with no prior-year data — visuals handle this cleanly - Requires a marked date table; if not marked, replace with `DATEADD('Date'[Date], -1, YEAR)` - Slicer selections (e.g. Region) are automatically respected via filter context **Simplified version:** ```dax Revenue YoY % Simple = DIVIDE( [Total Revenue] - CALCULATE([Total Revenue], SAMEPERIODLASTYEAR('Date'[Date])), CALCULATE([Total Revenue], SAMEPERIODLASTYEAR('Date'[Date])) ) ```

Try with these tools

claudechatgptnotebooklm
daxpower-bimeasuresai-assisted

More in Data & Analytics

FP&A KPI Dictionary Standardiser

A single KPI dictionary: definition, formula, source system, owner, and refresh cadence per metric.

intermediate

Procurement Spend Cube & Savings Finder

A cleansed spend cube (supplier × category × BU) with ranked savings opportunities.

intermediate

Master Data Golden Record & Dedup Ruleset

A concrete matching, survivorship, and golden-record ruleset for cleaning a customer or vendor master.

advanced