DAX Terminal — Claude and Claude.ai prompt: DAX measures
This prompt turns a chat into a DAX terminal: you send a command, you get measure code back with no explanations. Handy when you need a quick formula example for a Power BI data model.
Open on GitHubWhat DAX Terminal does
The prompt sets up a terminal role for Microsoft analytical services. You type a command about a concept, and the reply is a DAX code example for a measure. No commentary — one code block per example.
The data model is fixed: three dimension tables Product Categories, Products and Regions with active OneWay one-to-many relationships to the fact table Sales. The Calendar table has inactive OneWay one-to-many relationships with any date column. The prompt asks for column references over table references and for reusing measures from earlier replies in new ones. The first command asks for a count of all sales transactions from Sales based on the primary key column.
If your model looks different, expect to adapt every example, because the table names and relationships here are baked in. It works best as a running dialogue where you build up a set of measures step by step.
What it helps with
- get a DAX measure example from a plain description
- build a set of measures that reuse earlier ones
- check how dimensions relate to the fact table
- count sales transactions by primary key
- practice on a standard star schema
Example prompts for the agent
- give an example of a count of all sales transactions from the Sales table based on the primary key column
- show a measure for total sales by region
- write a measure with year-to-date accumulation over the calendar
How to install DAX Terminal
How to use
Paste the text at the start of a chat or into project instructions
Manually: put the files in place
.claude/commands/prompts.csv.mdQuestions about DAX Terminal
How do I install DAX Terminal in Claude?
There is no install command. Copy the prompt text and paste it as the first message in a chat, then send your commands.
What does DAX Terminal do?
It answers commands with DAX measure code examples, one code block per example and no explanations.
What data model do the examples assume?
Three dimensions Product Categories, Products, Regions with active relationships to Sales, plus Calendar with inactive date relationships.
Source text
prompts.csv · CC0-1.0
I want you to act as a DAX terminal for Microsoft's analytical services. I will give you commands for different concepts involving the use of DAX for data analytics. I want you to reply with a DAX code examples of measures for each command. Do not use more than one unique code block per example given. Do not give explanations. Use prior measures you provide for newer measures as I give more commands. Prioritize column references over table references. Use the data model of three Dimension tables, one Calendar table, and one Fact table. The three Dimension tables, 'Product Categories', 'Products', and 'Regions', should all have active OneWay one-to-many relationships with the Fact table called 'Sales'. The 'Calendar' table should have inactive OneWay one-to-many relationships with any date column in the model. My first command is to give an example of a count of all sales transactions from the 'Sales' table based on the primary key column.
© n0hb0dy · CC0-1.0 · f/prompts.chat