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
des_san
Helper I
Helper I

Count the number of "in progress" applications with IN and a OUT dates in a calendar table

Hi all,

 

I have a table that looks like this:

 

Application IDDate CreatedDate ResolvedStatus
00101/01/201901/05/2019Approved
00201/03/201901/07/2019Rejected
00301/09/2019 Pending

 

I would like to create a table that counts the number of applications that are in progress for each date, alongside a count of applications created or resolved on that date. For example:

 

Calendar DateCreatedResolvedIn Progress
01/01/2019100
01/02/2019001
01/03/2019101
01/04/2019002
01/05/2019011
01/06/2019001
01/07/2019010
01/08/2019000
01/09/2019100

 

Would you have a solution?

1 ACCEPTED SOLUTION

Hi @v-piga-msft ,

 

I figured it out. Thanks again for pointing me in the right direction.

 

Solution:

In the Date table I created the following measures and columns:

 

Created Count = CALCULATE(COUNT('Table'[CreatedDate]),FILTER('Table','Table'[CreatedDate ]='Date'[Date]))
Resolved Count = CALCULATE(COUNT('Table'[Date_Resolved]),FILTER(Table','Table'[Date_Resolved]='Date'[Date]))
In Progress = 
CALCULATE(
    COUNT('Table'[CreatedDate]),
    FILTER(
        'Table',
        'Table'[CreatedDate]<'Date'[Date] &&
        'Table'[Date_Resolved]>'Date'[Date]
    )
) 

The final result as a table is as desired:

DateCreated CountResolved CountIn Progress
7/31/201919351515,904
7/30/201922557916,195
7/29/201919553016,578
7/28/20191484016,960

 

Cheers,

View solution in original post

4 REPLIES 4
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @des_san ,

You could create the two calculated column like below in calendar table to achieve the Created and Resolved. And then create the measure with the dax below.

Created =
IF (
    LOOKUPVALUE ( 'Table'[Date Created], 'Table'[Date Created], 'calendar'[Date] ) > 0,
    1,
    0
)
Resloved =
IF (
    LOOKUPVALUE ( 'Table'[Date Resolved], 'Table'[Date Resolved], 'calendar'[Date] ) > 0,
    1,
    0
)
In Progress =
CALCULATE (
    COUNTROWS ( 'Table' ),
    FILTER (
        'Table',
        'Table'[Date Created] < MAX ( 'calendar'[Date] )
            && 'Table'[Date Resolved] > MAX ( 'calendar'[Date] )
    )
)

Here is the output.

result.PNG

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-piga-msft ,

 

Thank you, your response is very helpful. However, I noticed that if there are multiple created/resolved applications on a particular day the calculated columns aren't accounting for them. I'm only getting 1. Do you have any ideas that might help count for multiple apps in a day?

 

Best,

Hi @des_san ,

I'm a little confused about your requirement.

If it is convenient, could you describe your requirement in details and share the output you desired so that we could help further on it.

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-piga-msft ,

 

I figured it out. Thanks again for pointing me in the right direction.

 

Solution:

In the Date table I created the following measures and columns:

 

Created Count = CALCULATE(COUNT('Table'[CreatedDate]),FILTER('Table','Table'[CreatedDate ]='Date'[Date]))
Resolved Count = CALCULATE(COUNT('Table'[Date_Resolved]),FILTER(Table','Table'[Date_Resolved]='Date'[Date]))
In Progress = 
CALCULATE(
    COUNT('Table'[CreatedDate]),
    FILTER(
        'Table',
        'Table'[CreatedDate]<'Date'[Date] &&
        'Table'[Date_Resolved]>'Date'[Date]
    )
) 

The final result as a table is as desired:

DateCreated CountResolved CountIn Progress
7/31/201919351515,904
7/30/201922557916,195
7/29/201919553016,578
7/28/20191484016,960

 

Cheers,

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.