cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Javid777 Visitor
Visitor

Count of active contracts for each month

1Hi everyone,

 

 

Can you please help me with this question? Annotation 2019-02-04 140929.jpgI have got list of contracts since 2015 November to 2019 January. There are 2 types of them, active and expired. I need to calculate count of active contracts per month for each year

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Count of active contracts for each month

@Javid777,

 

Suppose the contracts count is based on the start_date. You can create calculate column using DAX like pattern below:

 

result =
CALCULATE (
    COUNT ( Table[comment] ),
    FILTER (
        Table,
        YEAR ( Table[start_date] ) = YEAR ( EARLIER ( Table[start_date] ) )
            && MONTH ( Table[start_date] ) = MONTH ( EARLIER ( Table[start_date] ) )
    )
)

Community Support Team _ Jimmy Tao

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

1 REPLY 1
Community Support Team
Community Support Team

Re: Count of active contracts for each month

@Javid777,

 

Suppose the contracts count is based on the start_date. You can create calculate column using DAX like pattern below:

 

result =
CALCULATE (
    COUNT ( Table[comment] ),
    FILTER (
        Table,
        YEAR ( Table[start_date] ) = YEAR ( EARLIER ( Table[start_date] ) )
            && MONTH ( Table[start_date] ) = MONTH ( EARLIER ( Table[start_date] ) )
    )
)

Community Support Team _ Jimmy Tao

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