Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Filter active projects based on selected date range

Hey all, I am working with data that looks very much like the following -  Team Project Start Finish Team A 1 10/10/2021 3/2/2022 Team A 2 1/1/2022 2/1/2022 Team B 3 8/4/2021...
  • bcdobbs's avatar
    bcdobbs
    4 years ago

    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:

     

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

     

    Hope it gives you some ideas!