Community编程与开发github.com

github/power-bi-dax-optimization

全面的Power BI DAX公式优化提示,用于提升DAX计算的性能、可读性和可维护性。

power-bi-dax-optimization 是什么?

该技能为开发者和AI助手提供了一个全面的优化提示,专注于改善Power BI中的DAX公式。它指导用户识别并解决性能瓶颈,如低效的迭代函数、不必要的计算上下文转换和冗余的筛选条件。技能建议采用最佳实践,包括使用变量、减少上下文转换、优先使用聚合函数而非迭代函数,以及利用TABULAR迭代器模式。此技能适用于Claude Code、Cursor等支持自定义规则/提示的AI编程助手,通过结构化指导帮助重构DAX代码,生成更高效且易于维护的度量值、计算列和查询,从而提升Power BI报表的整体响应速度和可管理性。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/github/awesome-copilot/tree/main/skills/power-bi-dax-optimization

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

power-bi-dax-optimization 是做什么的?

全面的Power BI DAX公式优化提示,用于提升DAX计算的性能、可读性和可维护性。

概述

该技能提供了一套完整的优化策略,帮助用户重构并优化Power BI中的DAX公式。通过遵循以下原则,您可以显著提升报表的响应速度并降低计算资源消耗。

关键优化原则

1. 使用变量(VAR)

  • 避免重复计算相同的表达式
  • 将复杂子表达式分解为逻辑变量
  • 简化调试并提高可读性

2. 减少上下文转换

  • 优先使用直接列引用而非过渡的CALCULATE函数
  • 在可能的情况下,使用SUMX、FILTER等迭代器,替代不必要的CALCULATE嵌套
  • 利用ALLEXCEPT、ALLSELECTED等筛选修饰符来精确定义筛选上下文

3. 优先使用聚合函数

  • 使用SUM、COUNT、AVERAGE等简单聚合函数,而非复杂的迭代器(除非绝对必要)
  • 对于聚合场景,使用SUMX时确保循环次数最小化

4. 避免冗余筛选

  • 移除不必要的FILTER函数,尤其是在整表扫描场景中
  • 使用TREATAS进行高效的跨表筛选,而非传统的FILTER(RELATEDTABLE(...))
  • 利用KEEPFILTERS保留现有筛选,避免意外覆盖

5. 利用TABULAR迭代器模式

  • 使用SUMMARIZE与ADDCOLUMNS组合来处理多重聚合
  • 采用VALUES、DISTINCT等表函数来优化上下文
  • 对于复杂的分组计算,考虑使用GROUPBY而非SUMMARIZE,以避免不必要的上下文转换

示例优化

原始公式

Total Revenue = SUMX(Sales, Sales[Quantity] * Sales[UnitPrice])

优化后公式

Total Revenue =
VAR QuantitySum = SUM(Sales[Quantity])
VAR PriceSum = SUM(Sales[UnitPrice])
RETURN
    QuantitySum * PriceSum

适用平台

  • Claude Code
  • Cursor
  • 其他支持自定义规则/提示的AI编程助手

如何使用

将此提示作为项目规则或会话指令添加到您的AI编程助手中,在编写或审查Power BI DAX代码时,技能将自动应用这些优化原则。

许可证

MIT

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

github/acquire-codebase-knowledge

Use this skill when the user explicitly asks to map, document, or onboard into an existing codebase. Trigger for prompts like "map this codebase", "document this architecture", "onboard me to this repo", or "create codebase docs". Do not trigger for routine feature implementation, bug fixes, or narrow code edits unless the user asks for repository-level discovery.

github/add-educational-comments

Add educational comments to the file specified, or prompt asking for file to comment if one is not provided.

github/agent-governance

Patterns and techniques for adding governance, safety, and trust controls to AI agent systems. Use this skill when: - Building AI agents that call external tools (APIs, databases, file systems) - Implementing policy-based access controls for agent tool usage - Adding semantic intent classification to detect dangerous prompts - Creating trust scoring systems for multi-agent workflows - Building audit trails for agent actions and decisions - Enforcing rate limits, content filters, or tool restrictions on agents - Working with any agent framework (PydanticAI, CrewAI, OpenAI Agents, LangChain, AutoGen)

github/agentic-eval

Patterns and techniques for evaluating and improving AI agent outputs. Use this skill when: - Implementing self-critique and reflection loops - Building evaluator-optimizer pipelines for quality-critical generation - Creating test-driven code refinement workflows - Designing rubric-based or LLM-as-judge evaluation systems - Adding iterative improvement to agent outputs (code, reports, analysis) - Measuring and improving agent response quality

github/agent-owasp-compliance

Check any AI agent codebase against the OWASP Agentic Security Initiative (ASI) Top 10 risks. Use this skill when: - Evaluating an agent system's security posture before production deployment - Running a compliance check against OWASP ASI 2026 standards - Mapping existing security controls to the 10 agentic risks - Generating a compliance report for security review or audit - Comparing agent framework security features against the standard - Any request like "is my agent OWASP compliant?", "check ASI compliance", or "agentic security audit"

github/ai-prompt-engineering-safety-review

Comprehensive AI prompt engineering safety review and improvement prompt. Analyzes prompts for safety, bias, security vulnerabilities, and effectiveness while providing detailed improvement recommendations with extensive frameworks, testing methodologies, and educational content.

github/appinsights-instrumentation

Instrument a webapp to send useful telemetry data to Azure App Insights

github/apple-appstore-reviewer

Serves as a reviewer of the codebase with instructions on looking for Apple App Store optimizations or rejection reasons.

github/architecture-blueprint-generator

Comprehensive project architecture blueprint generator that analyzes codebases to create detailed architectural documentation. Automatically detects technology stacks and architectural patterns, generates visual diagrams, documents implementation patterns, and provides extensible blueprints for maintaining architectural consistency and guiding new development.

github/arch-linux-triage

Triage and resolve Arch Linux issues with pacman, systemd, and rolling-release best practices.

github/arize-ai-provider-integration

Creates, reads, updates, and deletes Arize AI integrations that store LLM provider credentials used by evaluators and other Arize features. Supports any LLM provider (e.g. OpenAI, Anthropic, Azure OpenAI, AWS Bedrock, Vertex AI, Gemini, NVIDIA NIM). Use when the user mentions AI integration, LLM provider credentials, create integration, list integrations, update credentials, delete integration, or connecting an LLM provider to Arize.

github/arize-annotation

Creates and manages annotation configs (categorical, continuous, freeform label schemas) and annotation queues (human review workflows) on Arize. Applies human annotations to project spans via the Python SDK. Use when the user mentions annotation config, annotation queue, label schema, human feedback, bulk annotate spans, update_annotations, labeling queue, annotate record, or human review.

github/arize-dataset

Creates, manages, and queries Arize datasets and examples. Covers dataset CRUD, appending examples, exporting data, and file-based dataset creation using the ax CLI. Use when the user needs test data, evaluation examples, or mentions create dataset, list datasets, export dataset, append examples, dataset version, golden dataset, or test set.

github/arize-evaluator

Handles LLM-as-judge evaluation workflows on Arize including creating/updating evaluators, running evaluations on spans or experiments, managing tasks, trigger-run operations, column mapping, and continuous monitoring. Use when the user mentions create evaluator, LLM judge, hallucination, faithfulness, correctness, relevance, run eval, score spans, score experiment, trigger-run, column mapping, continuous monitoring, or improve evaluator prompt.

github/arize-experiment

Creates, runs, and analyzes Arize experiments for evaluating and comparing model performance. Covers experiment CRUD, exporting runs, comparing results, and evaluation workflows using the ax CLI. Use when the user mentions create experiment, run experiment, compare models, model performance, evaluate AI, experiment results, benchmark, A/B test models, or measure accuracy.

github/arize-instrumentation

Adds Arize AX tracing to an LLM application for the first time. Follows a two-phase agent-assisted flow to analyze the codebase then implement instrumentation after user confirmation. Use when the user wants to instrument their app, add tracing from scratch, set up LLM observability, integrate OpenTelemetry or openinference, or get started with Arize tracing.

github/arize-link

Generates deep links to the Arize UI for traces, spans, sessions, datasets, labeling queues, evaluators, and annotation configs. Produces clickable URLs for sharing Arize resources with team members. Use when the user wants to link to or open a trace, span, session, dataset, evaluator, or annotation config in the Arize UI.

github/arize-prompt-optimization

Optimizes, improves, and debugs LLM prompts using production trace data, evaluations, and annotations. Extracts prompts from spans, gathers performance signal, and runs a data-driven optimization loop using the ax CLI. Use when the user mentions optimize prompt, improve prompt, make AI respond better, improve output quality, prompt engineering, prompt tuning, or system prompt improvement.

github/arize-trace

Downloads, exports, and inspects existing Arize traces and spans to understand what an LLM app is doing or debug runtime issues. Covers exporting traces by ID, spans by ID, sessions by ID, and root-cause investigation using the ax CLI. Use when the user wants to look at existing trace data, see what their LLM app is doing, export traces, download spans, investigate errors, or analyze behavior regressions.

github/aspire

Aspire skill covering the Aspire CLI, AppHost orchestration, service discovery, integrations, MCP server, VS Code extension, Dev Containers, GitHub Codespaces, templates, dashboard, and deployment. Use when the user asks to create, run, debug, configure, deploy, or troubleshoot an Aspire distributed application.

相关技能