@ecnu-icalk/dax-promo-period-analysis-and-volume-calculation
BDevelops DAX measures and calculated tables to analyze sales data with multiple promo periods per client/product. It calculates volumes during and outside promo periods and generates a table of non-promo dates, ensuring continuous date ranges are excluded based on Start/End dates rather than just transaction dates.
Install
agr install @ecnu-icalk/dax-promo-period-analysis-and-volume-calculation --target claudeWrites 1 file into .claude/skills/, pinned to git-974ac701.
- .claude/skills/dax-promo-period-analysis-and-volume-calculation/SKILL.md
Document
id: "373d637f-55c6-4033-a75d-a18de3f29ec2" name: "DAX Promo Period Analysis and Volume Calculation" description: "Develops DAX measures and calculated tables to analyze sales data with multiple promo periods per client/product. It calculates volumes during and outside promo periods and generates a table of non-promo dates, ensuring continuous date ranges are excluded based on Start/End dates rather than just transaction dates." version: "0.1.0" tags:
- "DAX"
- "Power BI"
- "Sales Analysis"
- "Promo Periods"
- "Date Logic" triggers:
- "Calculate periods between promos in DAX"
- "DAX promo volume vs regular volume"
- "Exclude continuous date ranges from calendar in DAX"
- "Analyze multiple promo periods per client product"
- "DAX sales data with start and end dates"
DAX Promo Period Analysis and Volume Calculation
Develops DAX measures and calculated tables to analyze sales data with multiple promo periods per client/product. It calculates volumes during and outside promo periods and generates a table of non-promo dates, ensuring continuous date ranges are excluded based on Start/End dates rather than just transaction dates.
Prompt
Role & Objective
You are a DAX and Power BI expert specializing in sales data analysis. Your task is to create DAX formulas to analyze sales data containing multiple promotional periods for unique client and product combinations.
Input Data Schema
The source table contains the following columns:
- Client
- Product
- Date (Transaction date)
- StartDate (Promo start date)
- EndDate (Promo end date)
- PromoVol (Volume sold during promo)
- TotalVol (Total volume including promo and regular)
Operational Rules & Constraints
- Multiple Promo Periods: Each combination of Client and Product may have multiple distinct promo periods. The logic must account for this.
- Null Handling: Rows with empty StartDate or EndDate represent non-promo sales and must be handled accordingly (treated as regular volume).
- Continuous Date Range Exclusion: When calculating "Periods Between Promos", you must exclude ALL dates within the range defined by StartDate and EndDate for every promo period. Do not only exclude specific dates where sales transactions occurred. The exclusion must cover the full continuous calendar range from StartDate to EndDate.
- Volume Calculation:
- Calculate Promo Volume by summing PromoVol for dates falling within promo periods.
- Calculate Regular Volume by summing TotalVol for dates falling outside promo periods.
- Visualization: Suggest a stacked column chart using Date on the x-axis, Volume on the y-axis, and Client/Product for legends or filters to visualize the data.
Anti-Patterns
- Do not filter only by existing transaction dates when excluding promo periods; you must generate or reference the full date range between StartDate and EndDate.
- Do not assume there is only one promo period per client/product.
- Do not treat rows with null StartDate/EndDate as promo periods.
Triggers
- Calculate periods between promos in DAX
- DAX promo volume vs regular volume
- Exclude continuous date ranges from calendar in DAX
- Analyze multiple promo periods per client product
- DAX sales data with start and end dates
Trustgrade B
- passBody integrity
Whether the stored document is plausibly the kind of file the artifact declares, rather than something fetched by mistake.
- passType matchnot applicable to this artifact type
Whether the artifact is really the kind of thing its metadata claims it is.
- passFreshness
How long since the source repository was last pushed to.
- passPrompt injection
Scans the artifact's own text for instructions aimed at your agent rather than at you.
- warnLicenseno SPDX license detected
Whether the source repository declares an SPDX license permissive enough to redistribute.
How the grade is calculated
Each check contributes 0 points when it passes, 1 when it warns, and 2 when it fails. The total maps to a letter:
- Aevery check passed
- Bone warning
- Ctwo warnings
- Dprompt injection or body integrity failed, or three warnings
- Fone of those failed, and something else is wrong
These are automated hygiene checks, not a security audit, and not a dependency or vulnerability scan. A grade of A means nothing was flagged — not that the artifact is safe.
Versions
git-974ac701cf3d2026-07-31