Skip to content
Back to skills

Dax Date Intersection Count With Rankx

ASecurity

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.

  • 581 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added May 30, 2026
education

Security analysis

A100/100

Scanned May 30, 2026

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

Installs into .claude/skills of the current project.

Are you the author of Dax Date Intersection Count With Rankx?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Dax Date Intersection Count With Rankx
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-dax-date-intersection-count-with-rankx/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-dax-date-intersection-count-with-rankx)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "9d2f8df1-50f4-4d73-91a6-467ad148b942"
name: "DAX Date Intersection Count with RANKX"
description: "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."
version: "0.1.0"
tags:
  - "DAX"
  - "Power BI"
  - "RANKX"
  - "Window Function"
  - "Date Intersection"
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"
---

# 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

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.