Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ARomain
Helper I
Helper I

Count Cases based on Days between Dates

Trying to figure out the best way to do this.

 

I want to create a measure wheere I can Distinct Count cases where the FIRST Date of Request to Recieved Date is 15 days or less, as we can request items multiple times before we get them.

 

In the example below, Case 1 and 2 would be counted since the first request was 15 days or less. So my value would be 2. Case 3 had its first request 28 days before we got it and 4 was 19 days. The other dates do not matter, just the first. 

 

ARomain_0-1708471018207.png

 

3 ACCEPTED SOLUTIONS
ryan_mayu
Super User
Super User

@ARomain 

you can try to create a new column

Column = if('Table'[request date]=CALCULATE(min('Table'[request date]),ALLEXCEPT('Table','Table'[case id]))&&'Table'[Days Difference]<=15,1,0)

11.PNG

 

then you sum up the new column and you will get 2





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

lbendlin
Super User
Super User

Ahmedx
Super User
Super User

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Screenshot_1.png

View solution in original post

3 REPLIES 3
Ahmedx
Super User
Super User

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Screenshot_1.png

lbendlin
Super User
Super User

lbendlin_0-1708477262996.png

 

see attached

ryan_mayu
Super User
Super User

@ARomain 

you can try to create a new column

Column = if('Table'[request date]=CALCULATE(min('Table'[request date]),ALLEXCEPT('Table','Table'[case id]))&&'Table'[Days Difference]<=15,1,0)

11.PNG

 

then you sum up the new column and you will get 2





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.