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
ThomasWeppler
Impactful Individual
Impactful Individual

Number of open projects between open and close date at any date

I want to figure out how many project are open at any given time.

I define open as a project that has been started and not been closed yet.

 

What I have

A column with project id for all projects.

A  column with start date for all the projects

A column with closed date for all the closed projects and the date 01/01/1970 for all the projects that has not been closed yet.

All this info is in the same table

 

What I try to get

I want to figure out how many projects was open at any given date and which projects. The end user need to be able to pick the dates. I imagen a diagram that goes up all days where the number of open projects are higher and goes down whenever a project is closed. I also imagen that you can figure out which projects was open at any given day. This will be used for further analysis of which project leaders are busy, hwich customers is helped etc.

I am not sure if it is best to make it as a measure or a new column.

All feedback will be greatly appreciated.

1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

Hi @ThomasWeppler 

1. Create a date table. No relationships for the time being

2. Place DateT[Date] in the x axis of a (line) chart. If necessary create a slicer to select date ranges to show.

3. Create this measure and place it in Values of the chart:

Num open projects =
VAR currentDate_ = MAX ( DateT[Date] )
VAR closedProjectDate_ = DATE ( 1970, 1, 1 )
RETURN
    CALCULATE (
        DISTINCTCOUNT ( Table1[ ProjectID] ),
        Table1[StartDate] <= currentDate_,
        FILTER (
            ALL ( Table1[EndDate] ),
            Table1[EndDate] > currentDate_
                || Table1[EndDate] = closedProjectDate_
        )
    )

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

View solution in original post

3 REPLIES 3
ThomasWeppler
Impactful Individual
Impactful Individual

Thanks a lot AIB and Amitchandak.

I will take a closer look at your answers and see if I can solve my problem with your feedback.

AlB
Community Champion
Community Champion

Hi @ThomasWeppler 

1. Create a date table. No relationships for the time being

2. Place DateT[Date] in the x axis of a (line) chart. If necessary create a slicer to select date ranges to show.

3. Create this measure and place it in Values of the chart:

Num open projects =
VAR currentDate_ = MAX ( DateT[Date] )
VAR closedProjectDate_ = DATE ( 1970, 1, 1 )
RETURN
    CALCULATE (
        DISTINCTCOUNT ( Table1[ ProjectID] ),
        Table1[StartDate] <= currentDate_,
        FILTER (
            ALL ( Table1[EndDate] ),
            Table1[EndDate] > currentDate_
                || Table1[EndDate] = closedProjectDate_
        )
    )

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

amitchandak
Super User
Super User

@ThomasWeppler , see if my blog on similar topic help. You need to add code to handle the close date 01/01/1970 

 

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.