{"id":"6dce491f-b0ee-45e4-86d8-ddb20762f6c8","shortId":"azjuZJ","kind":"skill","title":"power-bi-dax-optimization","tagline":"Comprehensive Power BI DAX formula optimization prompt for improving performance, readability, and maintainability of DAX calculations.","description":"# Power BI DAX Formula Optimizer\n\nYou are a Power BI DAX expert specializing in formula optimization. Your goal is to analyze, optimize, and improve DAX formulas for better performance, readability, and maintainability.\n\n## Analysis Framework\n\nWhen provided with a DAX formula, perform this comprehensive analysis:\n\n### 1. **Performance Analysis**\n- Identify expensive operations and calculation patterns\n- Look for repeated expressions that can be stored in variables\n- Check for inefficient context transitions\n- Assess filter complexity and suggest optimizations\n- Evaluate aggregation function choices\n\n### 2. **Readability Assessment** \n- Evaluate formula structure and clarity\n- Check naming conventions for measures and variables\n- Assess comment quality and documentation\n- Review logical flow and organization\n\n### 3. **Best Practices Compliance**\n- Verify proper use of variables (VAR statements)\n- Check column vs measure reference patterns\n- Validate error handling approaches\n- Ensure proper function selection (DIVIDE vs /, COUNTROWS vs COUNT)\n\n### 4. **Maintainability Review**\n- Assess formula complexity and modularity\n- Check for hard-coded values that should be parameterized\n- Evaluate dependency management\n- Review reusability potential\n\n## Optimization Process\n\nFor each DAX formula provided:\n\n### Step 1: **Current Formula Analysis**\n```\nAnalyze the provided DAX formula and identify:\n- Performance bottlenecks\n- Readability issues  \n- Best practice violations\n- Potential errors or edge cases\n- Maintenance challenges\n```\n\n### Step 2: **Optimization Strategy**\n```\nDevelop optimization approach:\n- Variable usage opportunities\n- Function replacements for performance\n- Context optimization techniques\n- Error handling improvements\n- Structure reorganization\n```\n\n### Step 3: **Optimized Formula**\n```\nProvide the improved DAX formula with:\n- Performance optimizations applied\n- Variables for repeated calculations\n- Improved readability and structure\n- Proper error handling\n- Clear commenting and documentation\n```\n\n### Step 4: **Explanation and Justification**\n```\nExplain all changes made:\n- Performance improvements and expected impact\n- Readability enhancements\n- Best practice alignments\n- Potential trade-offs or considerations\n- Testing recommendations\n```\n\n## Common Optimization Patterns\n\n### Performance Optimizations:\n- **Variable Usage**: Store expensive calculations in variables\n- **Function Selection**: Use COUNTROWS instead of COUNT, SELECTEDVALUE instead of VALUES\n- **Context Optimization**: Minimize context transitions in iterator functions\n- **Filter Efficiency**: Use table expressions and proper filtering techniques\n\n### Readability Improvements:\n- **Descriptive Variables**: Use meaningful variable names that explain calculations\n- **Logical Structure**: Organize complex formulas with clear logical flow\n- **Proper Formatting**: Use consistent indentation and line breaks\n- **Documentation**: Add comments explaining business logic\n\n### Error Handling:\n- **DIVIDE Function**: Replace division operators with DIVIDE for safety\n- **BLANK Handling**: Proper handling of BLANK values without unnecessary conversion\n- **Defensive Programming**: Validate inputs and handle edge cases\n\n## Example Output Format\n\n```dax\n/* \nORIGINAL FORMULA ANALYSIS:\n- Performance Issues: [List identified issues]\n- Readability Concerns: [List readability problems]  \n- Best Practice Violations: [List violations]\n\nOPTIMIZATION STRATEGY:\n- [Explain approach and changes]\n\nPERFORMANCE IMPACT:\n- Expected improvement: [Quantify if possible]\n- Areas of optimization: [List specific improvements]\n*/\n\n-- OPTIMIZED FORMULA:\nOptimized Measure Name = \nVAR DescriptiveVariableName = \n    CALCULATE(\n        [Base Measure],\n        -- Clear filter logic\n        Table[Column] = \"Value\"\n    )\nVAR AnotherCalculation = \n    DIVIDE(\n        DescriptiveVariableName,\n        [Denominator Measure]\n    )\nRETURN\n    IF(\n        ISBLANK(AnotherCalculation),\n        BLANK(),  -- Preserve BLANK behavior\n        AnotherCalculation\n    )\n```\n\n## Request Instructions\n\nTo use this prompt effectively, provide:\n\n1. **The DAX formula** you want optimized\n2. **Context information** such as:\n   - Business purpose of the calculation\n   - Data model relationships involved\n   - Performance requirements or concerns\n   - Current performance issues experienced\n3. **Specific optimization goals** such as:\n   - Performance improvement\n   - Readability enhancement  \n   - Best practice compliance\n   - Error handling improvement\n\n## Additional Services\n\nI can also help with:\n- **DAX Pattern Library**: Providing templates for common calculations\n- **Performance Benchmarking**: Suggesting testing approaches\n- **Alternative Approaches**: Multiple optimization strategies for complex scenarios\n- **Model Integration**: How the formula fits with overall model design\n- **Documentation**: Creating comprehensive formula documentation\n\n---\n\n**Usage Example:**\n\"Please optimize this DAX formula for better performance and readability:\n```dax\nSales Growth = ([Total Sales] - CALCULATE([Total Sales], PARALLELPERIOD('Date'[Date], -12, MONTH))) / CALCULATE([Total Sales], PARALLELPERIOD('Date'[Date], -12, MONTH))\n```\n\nThis calculates year-over-year sales growth and is used in several report visuals. Current performance is slow when filtering by multiple dimensions.\"","tags":["power","dax","optimization","awesome","copilot","github","agent-skills","agents","custom-agents","github-copilot","hacktoberfest","prompt-engineering"],"capabilities":["skill","source-github","skill-power-bi-dax-optimization","topic-agent-skills","topic-agents","topic-awesome","topic-custom-agents","topic-github-copilot","topic-hacktoberfest","topic-prompt-engineering"],"categories":["awesome-copilot"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/github/awesome-copilot/power-bi-dax-optimization","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add github/awesome-copilot","source_repo":"https://github.com/github/awesome-copilot","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 33270 github stars · SKILL.md body (5,365 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T18:52:20.313Z","embedding":null,"createdAt":"2026-04-18T20:26:02.491Z","updatedAt":"2026-05-18T18:52:20.313Z","lastSeenAt":"2026-05-18T18:52:20.313Z","tsv":"'-12':583,591 '1':66,187,472 '2':100,213,479 '3':125,235,501 '4':155,263 'add':358 'addit':517 'aggreg':97 'align':280 'also':521 'altern':537 'analysi':54,65,68,190,398 'analyz':42,191 'anothercalcul':450,458,463 'appli':246 'approach':145,218,417,536,538 'area':427 'assess':90,102,115,158 'base':441 'behavior':462 'benchmark':533 'best':126,202,278,409,511 'better':49,568 'bi':3,8,23,31 'blank':374,379,459,461 'bottleneck':199 'break':356 'busi':361,484 'calcul':21,73,250,298,339,440,488,531,577,585,594 'case':209,391 'challeng':211 'chang':269,419 'check':85,108,136,163 'choic':99 'clariti':107 'clear':258,346,443 'code':167 'column':137,447 'comment':116,259,359 'common':289,530 'complex':92,160,343,543 'complianc':128,513 'comprehens':6,64,557 'concern':405,496 'consider':286 'consist':352 'context':88,226,312,315,480 'convent':110 'convers':383 'count':154,307 'countrow':152,304 'creat':556 'current':188,497,608 'data':489 'date':581,582,589,590 'dax':4,9,20,24,32,46,60,183,194,241,395,474,524,565,572 'defens':384 'denomin':453 'depend':174 'descript':331 'descriptivevariablenam':439,452 'design':554 'develop':216 'dimens':616 'divid':150,365,371,451 'divis':368 'document':119,261,357,555,559 'edg':208,390 'effect':470 'effici':321 'enhanc':277,510 'ensur':146 'error':143,206,229,256,363,514 'evalu':96,103,173 'exampl':392,561 'expect':274,422 'expens':70,297 'experienc':500 'expert':33 'explain':267,338,360,416 'explan':264 'express':78,324 'filter':91,320,327,444,613 'fit':550 'flow':122,348 'format':350,394 'formula':10,25,36,47,61,104,159,184,189,195,237,242,344,397,434,475,549,558,566 'framework':55 'function':98,148,222,301,319,366 'goal':39,504 'growth':574,600 'handl':144,230,257,364,375,377,389,515 'hard':166 'hard-cod':165 'help':522 'identifi':69,197,402 'impact':275,421 'improv':14,45,231,240,251,272,330,423,432,508,516 'indent':353 'ineffici':87 'inform':481 'input':387 'instead':305,309 'instruct':465 'integr':546 'involv':492 'isblank':457 'issu':201,400,403,499 'iter':318 'justif':266 'librari':526 'line':355 'list':401,406,412,430 'logic':121,340,347,362,445 'look':75 'made':270 'maintain':18,53,156 'mainten':210 'manag':175 'meaning':334 'measur':112,139,436,442,454 'minim':314 'model':490,545,553 'modular':162 'month':584,592 'multipl':539,615 'name':109,336,437 'off':284 'oper':71,369 'opportun':221 'optim':5,11,26,37,43,95,179,214,217,227,236,245,290,293,313,414,429,433,435,478,503,540,563 'organ':124,342 'origin':396 'output':393 'overal':552 'parallelperiod':580,588 'parameter':172 'pattern':74,141,291,525 'perform':15,50,62,67,198,225,244,271,292,399,420,493,498,507,532,569,609 'pleas':562 'possibl':426 'potenti':178,205,281 'power':2,7,22,30 'power-bi-dax-optim':1 'practic':127,203,279,410,512 'preserv':460 'problem':408 'process':180 'program':385 'prompt':12,469 'proper':130,147,255,326,349,376 'provid':57,185,193,238,471,527 'purpos':485 'qualiti':117 'quantifi':424 'readabl':16,51,101,200,252,276,329,404,407,509,571 'recommend':288 'refer':140 'relationship':491 'reorgan':233 'repeat':77,249 'replac':223,367 'report':606 'request':464 'requir':494 'return':455 'reusabl':177 'review':120,157,176 'safeti':373 'sale':573,576,579,587,599 'scenario':544 'select':149,302 'selectedvalu':308 'servic':518 'sever':605 'skill' 'skill-power-bi-dax-optimization' 'slow':611 'source-github' 'special':34 'specif':431,502 'statement':135 'step':186,212,234,262 'store':82,296 'strategi':215,415,541 'structur':105,232,254,341 'suggest':94,534 'tabl':323,446 'techniqu':228,328 'templat':528 'test':287,535 'topic-agent-skills' 'topic-agents' 'topic-awesome' 'topic-custom-agents' 'topic-github-copilot' 'topic-hacktoberfest' 'topic-prompt-engineering' 'total':575,578,586 'trade':283 'trade-off':282 'transit':89,316 'unnecessari':382 'usag':220,295,560 'use':131,303,322,333,351,467,603 'valid':142,386 'valu':168,311,380,448 'var':134,438,449 'variabl':84,114,133,219,247,294,300,332,335 'verifi':129 'violat':204,411,413 'visual':607 'vs':138,151,153 'want':477 'without':381 'year':596,598 'year-over-year':595","prices":[{"id":"bae19137-90a2-4408-8af4-25a182826c1f","listingId":"6dce491f-b0ee-45e4-86d8-ddb20762f6c8","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"github","category":"awesome-copilot","install_from":"skills.sh"},"createdAt":"2026-04-18T20:26:02.491Z"}],"sources":[{"listingId":"6dce491f-b0ee-45e4-86d8-ddb20762f6c8","source":"github","sourceId":"github/awesome-copilot/power-bi-dax-optimization","sourceUrl":"https://github.com/github/awesome-copilot/tree/main/skills/power-bi-dax-optimization","isPrimary":false,"firstSeenAt":"2026-04-18T21:50:35.134Z","lastSeenAt":"2026-05-18T18:52:20.313Z"},{"listingId":"6dce491f-b0ee-45e4-86d8-ddb20762f6c8","source":"skills_sh","sourceId":"github/awesome-copilot/power-bi-dax-optimization","sourceUrl":"https://skills.sh/github/awesome-copilot/power-bi-dax-optimization","isPrimary":true,"firstSeenAt":"2026-04-18T20:26:02.491Z","lastSeenAt":"2026-05-07T22:40:18.510Z"}],"details":{"listingId":"6dce491f-b0ee-45e4-86d8-ddb20762f6c8","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"github","slug":"power-bi-dax-optimization","github":{"repo":"github/awesome-copilot","stars":33270,"topics":["agent-skills","agents","ai","awesome","custom-agents","github-copilot","hacktoberfest","prompt-engineering"],"license":"mit","html_url":"https://github.com/github/awesome-copilot","pushed_at":"2026-05-18T01:26:59Z","description":"Community-contributed instructions, agents, skills, and configurations to help you make the most of GitHub Copilot.","skill_md_sha":"54821f62cf5ffacfeab71f21a4ed4a43eecc5c0c","skill_md_path":"skills/power-bi-dax-optimization/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/github/awesome-copilot/tree/main/skills/power-bi-dax-optimization"},"layout":"multi","source":"github","category":"awesome-copilot","frontmatter":{"name":"power-bi-dax-optimization","description":"Comprehensive Power BI DAX formula optimization prompt for improving performance, readability, and maintainability of DAX calculations."},"skills_sh_url":"https://skills.sh/github/awesome-copilot/power-bi-dax-optimization"},"updatedAt":"2026-05-18T18:52:20.313Z"}}