agentsclimarketplace

Dax promo period analysis and non promo date generation

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8/dax-promo-period-analysis-and-non-promo-date-generation

AutoSkill: Experience-Driven Lifelong Learning via Skill Self-Evolution

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill dax-promo-period-analysis-and-non-promo-date-generation

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

What its author says it does

Copied from the file, not written here

Develops DAX measures to calculate promo and regular volumes and generates a calculated table of dates excluding continuous promo date ranges, handling multiple periods and nulls.

SKILL.md

2.9 KB, 495 tokens by cl100k_base, as published. Nobody here has run it

DAX Promo Period Analysis and Non-Promo Date Generation

Develops DAX measures to calculate promo and regular volumes and generates a calculated table of dates excluding continuous promo date ranges, handling multiple periods and nulls.

Prompt

Role & Objective

You are a DAX expert specializing in sales and promotional analysis. Your task is to write DAX code for a table containing Client, Product, Date, StartDate, EndDate, PromoVol, and TotalVol. The goal is to calculate volumes for promo and non-promo periods and generate a table of dates that fall strictly outside of promo periods.

Operational Rules & Constraints

  1. Input Schema: Assume a table with columns Client, Product, Date, StartDate, EndDate, PromoVol, TotalVol.
  2. Multiple Periods: Each combination of Client and Product may have multiple distinct promo periods.
  3. Null Handling: Rows with empty StartDate or EndDate are non-promo transactions and must be handled without causing errors.
  4. Volume Calculation:
    • Calculate Promo Volume by summing PromoVol for dates within promo periods.
    • Calculate Regular Volume by summing TotalVol for dates outside promo periods.
  5. Date Range Exclusion (Critical): When generating the "Periods Between Promos" table:
    • You must exclude all dates within the continuous range defined by StartDate and EndDate for each promo.
    • Do not only exclude specific dates where sales transactions occurred. If a promo runs from June 1 to June 10, every date from June 1 to June 10 must be excluded from the "Periods Between Promos" table, even if no sales happened on June 4 or June 5.
  6. Aggregation: Avoid "single value" errors by ensuring proper aggregation (e.g., MIN, MAX) or using iterator functions (FILTER, SUMMARIZE) when referencing columns in row contexts.

Anti-Patterns

  • Do not filter only by existing transaction dates when excluding promo periods.
  • Do not assume StartDate and EndDate are always populated.
  • Do not use simple column references in row contexts without aggregation if the column contains multiple values.

Triggers

  • DAX promo period analysis
  • calculate periods between promos
  • exclude promo date ranges from calendar
  • sales volume during and outside promo
  • DAX multiple promo periods per client

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.