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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
gcompliance
Frequent Visitor

Help calculate and visualize in process days

Hello, I have two date columns Case Opened Date and Case Closed Date. I looking to figure out a way to show when an item was in process. Ideally we would like to be able to say for the month of Januaray 2020 we had x items in process. The logic I tossed around was:

 

For every calendar day (from day of first case – today):

                For each unique case:

                                If (today’s date >= case open date) & (today’s date < case closed date)

                                                Then open case count = open case count + 1

                                If (today’s date >= case open date) & (today’s date > case closed date)

                                                Then close case count = close case count + 1

 

I am not confident in my PowerBi skills to execute this properly. 

1 ACCEPTED SOLUTION
v-yuaj-msft
Community Support
Community Support

Hi @gcompliance ,

 

I have modified the following measure.

close case count = COUNTROWS(FILTER(ALL('Items'),TODAY()>=[A-StartDate]&&TODAY()>[A-EndDate]&&NOT(ISBLANK([A-EndDate]))))
Result:
v-yuaj-msft_0-1616478973779.png

Hope that's what you were looking for.

Best Regards,

Yuna

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-yuaj-msft
Community Support
Community Support

Hi @gcompliance ,

 

I have modified the following measure.

close case count = COUNTROWS(FILTER(ALL('Items'),TODAY()>=[A-StartDate]&&TODAY()>[A-EndDate]&&NOT(ISBLANK([A-EndDate]))))
Result:
v-yuaj-msft_0-1616478973779.png

Hope that's what you were looking for.

Best Regards,

Yuna

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-yuaj-msft
Community Support
Community Support

Hi @gcompliance ,

 

Based on your description, you can create two measures as follows.

My test table:

v-yuaj-msft_0-1616400475746.png

open case count = COUNTROWS(FILTER(ALL('Items'),TODAY()>=[A-StartDate]&&TODAY()<[A-EndDate]))
close case count = COUNTROWS(FILTER(ALL('Items'),TODAY()>=[A-StartDate]&&TODAY()>[A-EndDate]))
Result:
v-yuaj-msft_1-1616400490834.png

Hope that's what you were looking for.

Best Regards,

Yuna

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

@amitchandak 

 

I think I got closer with the help of your post. 

 

I created an CalenderAuto and used this 


Active Cases = CALCULATE(COUNTx(FILTER(Query1, Query1[Opened]<=max('CalendarAuto'[Date]) && (ISBLANK(Query1[Closed]) || Query1[Closed]>max('CalendarAuto'[Date]))),(Query1[Case Number])),CROSSFILTER(Query1[Opened],'CalendarAuto'[Date],None))

I am not getting the correct response. As of today March 22 we have 52 active cases. The function above does not come to that conclusion. I also want to be able to look back and say on March 22, 2020 how many active cases did we have on that day.

Do you think this will work if the close date is blank?

 

Open Date 12/1/2020 

Closed Date null

because the case has not closed yet.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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