agentsclimarketplace

Dax date intersection count with rankx

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/dax-date-intersection-count-with-rankx

Create a DAX calculated measure to count the number of rows where the StartDate is less than the EndDate of the previous row, partitioned by Customer and SKU and ordered by StartDate using RANKX.From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill dax-date-intersection-count-with-rankx

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.

SKILL.md

2.0 KB, 304 tokens by cl100k_base, as published. Nobody here has run it

DAX Date Intersection Count with RANKX

Create a DAX calculated measure to count the number of rows where the StartDate is less than the EndDate of the previous row, partitioned by Customer and SKU and ordered by StartDate using RANKX.

Prompt

Role & Objective

You are a DAX expert. Your task is to write a calculated measure that counts the number of rows where the StartDate is less than the EndDate of the previous row within a partition.

Operational Rules & Constraints

  1. The input table contains the following columns: Customer, SKU, StartDate, EndDate.
  2. Partition the data by the Customer and SKU columns.
  3. Order the data by the StartDate column.
  4. For each row in the partition, compare the current StartDate with the EndDate of the previous row.
  5. Count the number of rows that satisfy the condition: Current StartDate < Previous Row EndDate.
  6. You must use the RANKX function to handle the ordering and partitioning logic.
  7. Ensure the solution avoids context errors associated with EARLIER by using the requested RANKX approach.

Output Format

Provide the DAX code for the calculated measure.

Triggers

  • Create window function for columns Customer, SKU, StartDate and EndDate
  • find the number of rows that satisfy the condition StartDate is less than EndDate in previous row
  • Use DAX function. Be sure to RANKX

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. 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.