{"id":"6dce491f-b0ee-45e4-86d8-ddb20762f6c8","shortId":"azjuZJ","kind":"skill","title":"Power Bi Dax Optimization","tagline":"Awesome Copilot skill by Github","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"],"capabilities":["skill","source-github","category-awesome-copilot"],"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":{"install_from":"skills.sh"}},"qualityScore":"0.300","qualityRationale":"deterministic score 0.30 from registry signals: · indexed on skills.sh · published under github/awesome-copilot","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:v1","enrichmentVersion":1,"enrichedAt":"2026-04-22T11:40:19.719Z","embedding":null,"createdAt":"2026-04-18T20:26:02.491Z","updatedAt":"2026-04-22T11:40:19.719Z","lastSeenAt":"2026-04-22T11:40:19.719Z","tsv":"'-12':571,579 '1':54,175,460 '2':88,201,467 '3':113,223,489 '4':143,251 'add':346 'addit':505 'aggreg':85 'align':268 'also':509 'altern':525 'analysi':42,53,56,178,386 'analyz':30,179 'anothercalcul':438,446,451 'appli':234 'approach':133,206,405,524,526 'area':415 'assess':78,90,103,146 'awesom':5 'base':429 'behavior':450 'benchmark':521 'best':114,190,266,397,499 'better':37,556 'bi':2,11,19 'blank':362,367,447,449 'bottleneck':187 'break':344 'busi':349,472 'calcul':61,238,286,327,428,476,519,565,573,582 'case':197,379 'category-awesome-copilot' 'challeng':199 'chang':257,407 'check':73,96,124,151 'choic':87 'clariti':95 'clear':246,334,431 'code':155 'column':125,435 'comment':104,247,347 'common':277,518 'complex':80,148,331,531 'complianc':116,501 'comprehens':52,545 'concern':393,484 'consider':274 'consist':340 'context':76,214,300,303,468 'convent':98 'convers':371 'copilot':6 'count':142,295 'countrow':140,292 'creat':544 'current':176,485,596 'data':477 'date':569,570,577,578 'dax':3,12,20,34,48,171,182,229,383,462,512,553,560 'defens':372 'denomin':441 'depend':162 'descript':319 'descriptivevariablenam':427,440 'design':542 'develop':204 'dimens':604 'divid':138,353,359,439 'divis':356 'document':107,249,345,543,547 'edg':196,378 'effect':458 'effici':309 'enhanc':265,498 'ensur':134 'error':131,194,217,244,351,502 'evalu':84,91,161 'exampl':380,549 'expect':262,410 'expens':58,285 'experienc':488 'expert':21 'explain':255,326,348,404 'explan':252 'express':66,312 'filter':79,308,315,432,601 'fit':538 'flow':110,336 'format':338,382 'formula':13,24,35,49,92,147,172,177,183,225,230,332,385,422,463,537,546,554 'framework':43 'function':86,136,210,289,307,354 'github':9 'goal':27,492 'growth':562,588 'handl':132,218,245,352,363,365,377,503 'hard':154 'hard-cod':153 'help':510 'identifi':57,185,390 'impact':263,409 'improv':33,219,228,239,260,318,411,420,496,504 'indent':341 'ineffici':75 'inform':469 'input':375 'instead':293,297 'instruct':453 'integr':534 'involv':480 'isblank':445 'issu':189,388,391,487 'iter':306 'justif':254 'librari':514 'line':343 'list':389,394,400,418 'logic':109,328,335,350,433 'look':63 'made':258 'maintain':41,144 'mainten':198 'manag':163 'meaning':322 'measur':100,127,424,430,442 'minim':302 'model':478,533,541 'modular':150 'month':572,580 'multipl':527,603 'name':97,324,425 'off':272 'oper':59,357 'opportun':209 'optim':4,14,25,31,83,167,202,205,215,224,233,278,281,301,402,417,421,423,466,491,528,551 'organ':112,330 'origin':384 'output':381 'overal':540 'parallelperiod':568,576 'parameter':160 'pattern':62,129,279,513 'perform':38,50,55,186,213,232,259,280,387,408,481,486,495,520,557,597 'pleas':550 'possibl':414 'potenti':166,193,269 'power':1,10,18 'practic':115,191,267,398,500 'preserv':448 'problem':396 'process':168 'program':373 'prompt':457 'proper':118,135,243,314,337,364 'provid':45,173,181,226,459,515 'purpos':473 'qualiti':105 'quantifi':412 'readabl':39,89,188,240,264,317,392,395,497,559 'recommend':276 'refer':128 'relationship':479 'reorgan':221 'repeat':65,237 'replac':211,355 'report':594 'request':452 'requir':482 'return':443 'reusabl':165 'review':108,145,164 'safeti':361 'sale':561,564,567,575,587 'scenario':532 'select':137,290 'selectedvalu':296 'servic':506 'sever':593 'skill':7 'slow':599 'source-github' 'special':22 'specif':419,490 'statement':123 'step':174,200,222,250 'store':70,284 'strategi':203,403,529 'structur':93,220,242,329 'suggest':82,522 'tabl':311,434 'techniqu':216,316 'templat':516 'test':275,523 'total':563,566,574 'trade':271 'trade-off':270 'transit':77,304 'unnecessari':370 'usag':208,283,548 'use':119,291,310,321,339,455,591 'valid':130,374 'valu':156,299,368,436 'var':122,426,437 'variabl':72,102,121,207,235,282,288,320,323 'verifi':117 'violat':192,399,401 'visual':595 'vs':126,139,141 'want':465 'without':369 'year':584,586 'year-over-year':583","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-04-22T06:52:27.831Z"},{"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-04-22T11:40:19.719Z"}],"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","source":"skills_sh","category":"awesome-copilot","skills_sh_url":"https://skills.sh/github/awesome-copilot/power-bi-dax-optimization"},"updatedAt":"2026-04-22T11:40:19.719Z"}}