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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Castle85
Frequent Visitor

Measure to count the number of projects that are active by month

Hi all,

 

I have a set of data that tracks 'jobs' there is a field for 'Date' which is the date the job enters the queue and a field for 'Due Date' in the same row, this is the due date until the job is 'Completed' where the 'Due Date' field becomes the completion date. I have data that goes back to Jan 2021 and am looking to create a measure that determines per month, a count of how many active requests there were i.e. a count of the number of rows where the value in my table is between the 'Date' and 'Due Date' a number of requests will span multiple months. I have tried the below and the numbers are way off it's giving a count in the hundreds where the number of active requests per month are typically ~ in the 30s/40s. I wonder if I have to divide by number of days in a month or something but alas any help appreciated!

 

Active =
SUMX (
    'Tracking',
    CALCULATE (
        COUNTROWS ( 'Tracking' ),
        FILTER (
            'Tracking',
            [Date] >= 'Tracking'[Date]
                && [Date] <= 'Tracking'[Due Date].[Date]
        )
    )
)
2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Castle85 , Refer to the approach used for Active Employee in Blog or files attached

 

Power BI: HR Analytics - Employees as on Date: https://youtu.be/e6Y-l_JtCq4
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
Power BI HR Active Employee Tenure Bucketing, and Hired, Terminated, and Active employees: https://youtu.be/fvgcx8QLqZU

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

Anonymous
Not applicable

Hi @Castle85 ,

 

To calculate the number of active requests per month based on the given conditions, you need to create a calendar table and then use that table to calculate the number of active requests per month.
Refer to the following code:

1. create calendar table:

Calendar = CALENDAR(MIN('Tracking'[Date]), MAX('Tracking'[Due Date]))

 

2. modify your dax:

Active  = 
CALCULATE (
    COUNTROWS('Tracking'),
    FILTER (
        'Calendar',
        'Calendar'[Date] >= 'Tracking'[Date]
        && 'Calendar'[Date] <= 'Tracking'[Due Date].[Date]
    )
)


Best Regards,
Adamk Kong

 

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

3 REPLIES 3
Anonymous
Not applicable

Hi @Castle85 ,

 

To calculate the number of active requests per month based on the given conditions, you need to create a calendar table and then use that table to calculate the number of active requests per month.
Refer to the following code:

1. create calendar table:

Calendar = CALENDAR(MIN('Tracking'[Date]), MAX('Tracking'[Due Date]))

 

2. modify your dax:

Active  = 
CALCULATE (
    COUNTROWS('Tracking'),
    FILTER (
        'Calendar',
        'Calendar'[Date] >= 'Tracking'[Date]
        && 'Calendar'[Date] <= 'Tracking'[Due Date].[Date]
    )
)


Best Regards,
Adamk Kong

 

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

Thanks for your help but this unfortunately gives an error;

 

Castle85_0-1706192801813.png

Any help appreciated with this one!

amitchandak
Super User
Super User

@Castle85 , Refer to the approach used for Active Employee in Blog or files attached

 

Power BI: HR Analytics - Employees as on Date: https://youtu.be/e6Y-l_JtCq4
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
Power BI HR Active Employee Tenure Bucketing, and Hired, Terminated, and Active employees: https://youtu.be/fvgcx8QLqZU

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

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.

Top Solution Authors
Top Kudoed Authors