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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.