dax-authoring

द्वारा microsoft

Power BI सिमेंटिक मॉडल के विरुद्ध DAX क्वेरी लिखें और परीक्षण करें। इसमें DAX सिंटैक्स नियम, क्वेरी पैटर्न, टाइम इंटेलिजेंस, और एक पुनरावृत्त परीक्षण वर्कफ़्लो शामिल है…

npx skills add https://github.com/microsoft/fabric-apps-analytic-templates --skill dax-authoring

DAX Authoring

Table of Contents

TaskReferenceNotes
Must/Prefer/AvoidSKILL.md: Must/Prefer/AvoidGuardrails for DAX query generation
Generating DAX QueriesSKILL.md: Generating DAX QueriesCore rules, inline examples, EVALUATE/DEFINE patterns
DAX Query Structure & Syntaxdax-query-patterns.md: Query StructureDEFINE / EVALUATE / ORDER BY / START AT
DAX Query Key Componentsdax-query-patterns.md: Key ComponentsDEFINE VAR, DEFINE MEASURE, table expressions
DAX Query Worked Examplesdax-query-patterns.md: Common Patterns11 annotated examples from simple aggregation to cross-table joins
DAX Query Anti-Patternsdax-query-patterns.md: Anti-PatternsWhat to avoid in DAX queries
CALCULATE & CALCULATETABLEdax-core-reference.md: CALCULATE & CALCULATETABLEContext transition, filter types, boolean restrictions, common patterns
SUMMARIZECOLUMNSdax-core-reference.md: SUMMARIZECOLUMNSArgument order, auto-blank elimination, filter args, vs SUMMARIZE
ALL & ALLEXCEPTdax-core-reference.md: ALL & ALLEXCEPTCALCULATE modifier vs table function; percentage patterns
TREATASdax-core-reference.md: TREATASVirtual relationships, multi-column filtering
DAX Syntax Rulesdax-core-reference.md: DAX Syntax RulesEVALUATE, CALCULATE, naming, SQL keywords, DEFINE rules
Common Mistakesdax-core-reference.md: Common MistakesVariable naming, quoting, escaping, scalar EVALUATE, multi-table SUMMARIZECOLUMNS
BLANK Semanticsdax-core-reference.md: BLANK SemanticsBLANK vs NULL, propagation, equality, ISBLANK, DIVIDE, non-empty semantics
Time Intelligence PatternsSKILL.md: Time IntelligenceWhen to consult TI reference
Date Table Prerequisitesdax-time-intelligence.md: PrerequisitesDate table requirements, mark as date table
YTD / QTD / MTDdax-time-intelligence.md: Period-to-DateTOTALYTD, DATESYTD, DATESINPERIOD patterns
Year-over-Year / Period Comparisonsdax-time-intelligence.md: Period ComparisonsSAMEPERIODLASTYEAR, DATEADD, PARALLELPERIOD
Rolling Windowsdax-time-intelligence.md: Rolling WindowsDATESINPERIOD rolling 12-month patterns
Opening/Closing Balancesdax-time-intelligence.md: BalancesSemi-additive measures, LASTDATE, LASTNONBLANK
TI in DAX Queries (Critical Rules)dax-time-intelligence.md: Critical Rules for TI in QueriesCALCULATETABLE + TREATAS pattern for query context
TI Common Mistakesdax-time-intelligence.md: Common MistakesMissing date table, wrong granularity, fiscal calendar
Testing & IterationSKILL.md: Testing & IterationExecute → inspect → fix → re-test workflow

Must / Prefer / Avoid

Must

  • Always test generated DAX via npx fabric-app-data query <alias> --query '<DAX>' before using in app code
  • Use fully-qualified 'Table'[Column] for column references
  • Use simple [Measure] for measure references
  • Use DEFINE for VAR and local MEASURE declarations (single DEFINE block, no commas)
  • Prefer existing model measures over re-aggregating raw data

Prefer

  • SUMMARIZECOLUMNS as the primary grouping function for queries
  • TREATAS for filter arguments in SUMMARIZECOLUMNS
  • Variables (VAR) to improve readability and avoid repeated calculations

Avoid

  • SQL keywords (SELECT, WHERE, HAVING, etc.) within DAX expressions
  • EVALUATE with scalar functions directly (wrap in ROW or table function)

Generating DAX Queries

DAX Syntax Rules

  • Measures are named objects in the semantic model. They specify how to aggregate data. Measures should be used first to answer user requests before a new DAX formula is used to aggregate data.
  • EVALUATE Statement: Not a function but a statement. It must always precede a table expression. Avoid pairing EVALUATE with scalar functions like CONCATENATEX, SUMX, DISTINCTCOUNT, etc.
  • Use the fully-qualified name 'Table'[Column] for column references, and the simple name [Measure] for measure references.
  • CALCULATE takes a scalar expression as its first argument. CALCULATETABLE takes a table expression as its first argument.
  • SUMMARIZECOLUMNS requires a specific order: groupby columns, then filters, then aggregations/measures.
  • Do not use SUMMARIZECOLUMNS when there is no aggregation and the groupby columns belong to more than one table; use VALUES, SUMMARIZE, or SELECTCOLUMNS instead.
  • When using SELECTCOLUMNS or CALCULATETABLE, include any columns needed downstream (ORDER BY, FILTER).
  • Filters propagate across relationships based on unidirectional or bidirectional settings.
  • INTERSECT, UNION, EXCEPT require identical column counts in both inputs.
  • For current date/time, use TODAY() or NOW().

Inline Examples

Simple filtered aggregation:

// Total sales for red products
EVALUATE
  ROW("Total Sales Amount", CALCULATE([Total Amount], 'Product'[Color] == "Red"))

Multi-filter grouping with SUMMARIZECOLUMNS:

DEFINE
  VAR _Filter1 = TREATAS({"Consumer Electronics"}, 'Product'[Category])
  VAR _Filter2 = FILTER(ALL('Calendar'[Year]), 'Calendar'[Year] >= 2022 && 'Calendar'[Year] <= 2023)

EVALUATE
  SUMMARIZECOLUMNS(
    'Calendar'[Year],
    'Calendar'[Month],
    _Filter1,
    _Filter2,
    "Total Quantity", SUM('Sales'[Order Quantity]),
    "Discount", [Total Discount]
  )

TopN with filtering:

DEFINE
  VAR _Filter = TREATAS({"Red", "Black"}, 'Product'[Color])
  VAR _Core = SUMMARIZECOLUMNS('Product'[Name], _Filter, "Total Sales", [Total Amount])

EVALUATE
  TOPN(10, _Core, [Total Sales], DESC)

For full syntax reference, worked examples, and anti-patterns, see dax-query-patterns.md. For function details, see dax-core-reference.md.

Time Intelligence

Time intelligence functions enable period-based analysis (YTD, YoY, rolling windows, etc.). They require a properly configured Date table.

Consult dax-time-intelligence.md whenever the user's request involves:

  • Period-to-date calculations (YTD, QTD, MTD)
  • Period comparisons (Year-over-Year, Month-over-Month)
  • Rolling windows (last 12 months, last 30 days)
  • Opening/closing balances
  • Custom date ranges

Testing & Iteration

  1. Generate the DAX query expression
  2. Execute via npx fabric-app-data query <alias> --query '<DAX>'
  3. Inspect results: check column names, data types, row counts, and actual data values
  4. If error: consult dax-core-reference.md, fix, and re-test
  5. Iterate until the query returns expected results

Query Execution

Use npx fabric-app-data query <alias> --query '<DAX>' to run queries. This uses the same SDK pipeline as the running app, so results are identical to what the app produces at runtime. To re-test an existing .dax file without copying the query text, use --file: npx fabric-app-data query <alias> --file src/queries/revenue.dax. For full CLI options (profiles, result limits), see the fabric-cli skill.

Result trimming: The CLI returns at most 1000 rows by default. When the result is trimmed, the output includes a _cliWarning field (e.g., "Result trimmed to first 1000 of 5000 rows"). This is a CLI-only limitation — the full dataset is available in the running app. If you need to see more data, refine your DAX with filters or aggregations.

Troubleshooting

ProblemSolution
CLI query fails with "not signed in"Run az login to sign in to Azure CLI
CLI query fails with "Azure CLI is not installed"Install from https://aka.ms/install-azure-cli
CLI query fails with "alias not found"Run npx fabric-app-data list to check available aliases, then npx fabric-app-data add to register
DAX syntax errorsConsult dax-core-reference.md — check reserved keywords, quoting rules, EVALUATE/scalar mistakes
Unexpected query resultsCheck filter context, relationship direction, BLANK handling in dax-core-reference.md
Time intelligence returns wrong valuesCheck date table prerequisites and critical rules in dax-time-intelligence.md

microsoft की और Skills

oss-growth
microsoft
OSS ग्रोथ हैकर व्यक्तित्व
agent-framework-azure-ai-py
microsoft
Microsoft Agent Framework Python SDK (agent-framework-azure-ai) का उपयोग करके Azure AI Foundry एजेंट बनाएं। AzureAIAgentsProvider के साथ स्थायी एजेंट बनाते समय, होस्टेड टूल्स (कोड इंटरप्रेटर, फ़ाइल खोज, वेब खोज) का उपयोग करते समय, MCP सर्वर एकीकृत करते समय, वार्तालाप थ्रेड प्रबंधित करते समय, या स्ट्रीमिंग प्रतिक्रियाएँ लागू करते समय उपयोग करें। फ़ंक्शन टूल्स, संरचित आउटपुट और मल्टी-टूल एजेंट शामिल हैं।
development
airunway-aks-setup
microsoft
AI Runway को AKS पर सेट करें — बेयर क्लस्टर से चल रहे मॉडल तक। इसमें क्लस्टर सत्यापन, कंट्रोलर इंस्टॉल, GPU मूल्यांकन, प्रोवाइडर सेटअप, और पहली डिप्लॉयमेंट शामिल है। कब: "setup AI Runway", "onboard AKS cluster", "install AI Runway", "airunway setup", "deploy model to AKS", "GPU inference on AKS", "KAITO setup on AKS", "run LLM on AKS", "vLLM on AKS", "set up model serving on AKS", "AI Runway controller"।
devops
appinsights-instrumentation
microsoft
Azure Application Insights के साथ वेबऐप्स को इंस्ट्रूमेंट करने के लिए मार्गदर्शन। टेलीमेट्री पैटर्न, SDK सेटअप, और कॉन्फ़िगरेशन संदर्भ प्रदान करता है। WHEN: ऐप को कैसे इंस्ट्रूमेंट करें, App Insights SDK, टेलीमेट्री पैटर्न, App Insights क्या है, Application Insights मार्गदर्शन, इंस्ट्रूमेंटेशन उदाहरण, APM सर्वोत्तम अभ्यास।
devops
applicationinsights-web-ts
microsoft
ब्राउज़र/वेब ऐप्स को Application Insights JavaScript SDK (@microsoft/applicationinsights-web) से इंस्ट्रूमेंट करें। Real User Monitoring (RUM) के लिए उपयोग करें — पेज व्यू, क्लिक, AJAX/fetch निर्भरताएँ, अपवाद, कस्टम इवेंट, और बैकएंड OpenTelemetry ट्रेस से सहसंबंधित ब्राउज़र-साइड GenAI एजेंट ट्रेस। SDK Loader Script और npm सेटअप, फ्रेमवर्क एक्सटेंशन (React, React Native, Angular), Click Analytics, टेलीमेट्री इनिशियलाइज़र, और ब्राउज़र से उत्सर्जित एजेंट/टूल/मॉडल स्पैन के लिए OTel GenAI सिमेंटिक कन्वेंशन शामिल हैं।
devops
azure-ai-anomalydetector-java
microsoft
Azure AI Anomaly Detector SDK for Java के साथ एनोमली डिटेक्शन एप्लिकेशन बनाएं। यूनीवेरिएट/मल्टीवेरिएट एनोमली डिटेक्शन, टाइम-सीरीज़ विश्लेषण, या AI-संचालित मॉनिटरिंग लागू करते समय उपयोग करें।
development
azure-ai-language-conversations-py
microsoft
<text> azure-ai-language-conversations Python SDK का उपयोग करके संवादात्मक भाषा समझ (CLU) लागू करें। ConversationAnalysisClient के साथ काम करते समय उपयोग करें ताकि वार्तालाप के इरादे और संस्थाओं का विश्लेषण किया जा सके, NLP सुविधाएँ बनाई जा सकें, या अनुप्रयोगों में भाषा समझ को एकीकृत किया जा सके। </text>
development
azure-ai-ml-py
microsoft
Azure Machine Learning SDK v2 for Python। ML वर्कस्पेस, जॉब्स, मॉडल, डेटासेट, कंप्यूट और पाइपलाइन के लिए उपयोग करें। ट्रिगर्स: "azure-ai-ml", "MLClient", "workspace", "model registry", "training jobs", "datasets"।
development