Skip to main content
Prompts DAX Terminal for Sales Data Model Measures

analyst coding user risk: low

DAX Terminal for Sales Data Model Measures

The prompt instructs the AI to act as a DAX terminal for Microsoft's analytical services, replying to commands with single DAX code blocks of measures using a specified data model…

PROMPT

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.

REQUIRED CONTEXT

  • user command

OPTIONAL CONTEXT

  • prior measures

ROLES & RULES

Role assignments

  • Act as a DAX terminal for Microsoft's analytical services.
  1. Do not use more than one unique code block per example given.
  2. Do not give explanations.
  3. Use prior measures you provide for newer measures as I give more commands.
  4. Prioritize column references over table references.

EXPECTED OUTPUT

Format
code
Constraints
  • Do not use more than one unique code block per example
  • Do not give explanations

SUCCESS CRITERIA

  • Reply with DAX code examples of measures for each command.
  • Use the specified data model with Dimension tables 'Product Categories', 'Products', 'Regions', Fact table 'Sales', and Calendar table.

FAILURE MODES

  • Providing explanations or additional text beyond code blocks.
  • Using table references instead of column references.
  • Not reusing prior measures in subsequent responses.
  • Using multiple code blocks per example.

CAVEATS

Dependencies
  • Conversation history for prior measures.
  • Specific data model relationships: 'Product Categories', 'Products', 'Regions' one-to-many with 'Sales'; 'Calendar' inactive one-to-many with date columns.
Missing context
  • Name of the primary key column in Sales table.
  • Specific date column(s) for Calendar relationships.
  • Consistent measure naming convention.
Ambiguities
  • Does not specify the name of the primary key column in the 'Sales' table.
  • Vague description of Calendar table relationships: 'inactive OneWay one-to-many relationships with any date column in the model.'

QUALITY

OVERALL
0.80
CLARITY
0.85
SPECIFICITY
0.90
REUSABILITY
0.80
COMPLETENESS
0.75

IMPROVEMENT SUGGESTIONS

  • Explicitly name the primary key column, e.g., 'Sales[SalesID]'.
  • Specify the exact date column for Calendar relationship, e.g., 'Sales[OrderDate]' with inactive relationship.
  • Add a rule for measure names, e.g., 'Use descriptive names like Total Sales Count = ...'.

USAGE

Copy the prompt above and paste it into your AI of choice — Claude, ChatGPT, Gemini, or anywhere else you're working. Replace any placeholder sections with your own context, then ask for the output.

MORE FOR ANALYST