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
Anonymous
Not applicable

Filter active projects based on selected date range

Hey all,

I am working with data that looks very much like the following - 

TeamProjectStartFinish
Team A110/10/20213/2/2022
Team A21/1/20222/1/2022
Team B38/4/20215/1/2022
Team B42/2/20222/20/2022
Team B51/5/20224/10/2022
Team C63/8/20224/10/2022

 

My goal is to filter all active Projects in a Gantt/Table for specific Months or custom Date Range, as well as selected Team.

 

Based on many recommendations on the forum,  I have tried creating a Date dimension table and using min/max to filter projects out, but I am not sure how to create a relationship with the main table so that I can filter Team. If I connect Date > Finish, then the Month filter only works for projects ending on that specific month, and I cannot have multiple relationships for Start. Was trying to use USERELATIONSHIP but was unable to make it work. 

Another possible solution that came to mind is to have a calculated column that has a filtering value based on the selected date value, but not sure how to make it work for a range.

I will also use the result to get a weighted average based on how long the project was active per month per team.

Any advice is appreciated!!

1 ACCEPTED SOLUTION

Sorry I had my filters the wrong way round see if it's any better now? (Same link)

Project Filter = 
VAR EarliestVisibleDate = MIN ( 'Date'[Date] )
VAR LatestVisibleDate = MAX ( 'Date'[Date] )

VAR FilteredProjects = 
    FILTER (
        Project,
        Project[Finish] >= EarliestVisibleDate && Project[Start] <= LatestVisibleDate
    )

RETURN INT ( NOT ( ISEMPTY ( FilteredProjects ) ) )


Alternatively have a look at the second file on the same link. It uses power query to transform your table into a row per day per project:

 

bcdobbs_0-1644616405224.png

This has the advantage of just being able to use a straight relationship.

 

Hope it gives you some ideas!



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

View solution in original post

5 REPLIES 5
bcdobbs
Community Champion
Community Champion

So you have two main options.

First one is to leave your date table disconnected and do all the work in DAX.

 

Add a measure like:

Project Filter = 
VAR EarliestVisibleDate = MIN ( 'Date'[Date] )
VAR LatestVisibleDate = MAX ( 'Date'[Date] )

VAR FilteredProjects = 
    FILTER (
        Project,
        Project[Start] >= EarliestVisibleDate && Project[Finish] <= LatestVisibleDate
    )

RETURN INT ( NOT ( ISEMPTY ( FilteredProjects ) ) )

 

And use it as a visual filter set to 1:

 

bcdobbs_0-1644614501157.png

Example file here

My prefered option is to change the grain of your table so there is one row per day. I'll send an example shortly.



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Anonymous
Not applicable

The first option doesn't seem to work. I believe it does not apply to tasks that have their start/finish outside of the date range, which are also active projects.

Sorry I had my filters the wrong way round see if it's any better now? (Same link)

Project Filter = 
VAR EarliestVisibleDate = MIN ( 'Date'[Date] )
VAR LatestVisibleDate = MAX ( 'Date'[Date] )

VAR FilteredProjects = 
    FILTER (
        Project,
        Project[Finish] >= EarliestVisibleDate && Project[Start] <= LatestVisibleDate
    )

RETURN INT ( NOT ( ISEMPTY ( FilteredProjects ) ) )


Alternatively have a look at the second file on the same link. It uses power query to transform your table into a row per day per project:

 

bcdobbs_0-1644616405224.png

This has the advantage of just being able to use a straight relationship.

 

Hope it gives you some ideas!



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Anonymous
Not applicable

@bcdobbs 

I would have ideally implemented the first option, but seems to have a lot of limitations, especially when dealing with Months and multiple visuals. Eg. Projects that are Finishing before the end of the Month, but still need to be part of Active Projects.

 

However, the second example is working perfectly! There were too many columns in the actual table so I ended up creating a reference table with a bidirectional relationship for just the primary key and dates.

 

Thank you so much for your assistance!!

No worries. You can further modify the filter on option 1 to include an OR statement (use || and brackets) to make it more inclusive.

 

Option 2 though is more flexible and much much faster on large datasets.



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

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.