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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Lucht
New Member

Date list with active projects based on start and enddate

Hello PBI community,


I have this table:


Project dStart          dEnd
001      24-01-2023 10-02-2023
002      25-01-2023 31-01-2023
003      05-02-2022 11-02-2023

 

I would like to create a long date-list of it. With all the dates that have active projects. This would mean that dates should be added multiple time if there are multiple active projects on that date. It should look something like this:

 

Date             Project
24-01-2023  001
25-01-2023  001
25-01-2023  002
26-01-2023  001
26-01-2023  002

3 REPLIES 3
tt_and
Helper I
Helper I

Have you considered doing this with Power Query?

 

 

let
    Source = #"I have this data",
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(Source, {"Project"}, "Attribute", "Value"),
    #"Renamed Columns" = Table.RenameColumns(#"Unpivoted Columns",{{"Attribute", "dName"}})
in
    #"Renamed Columns"

Screenshot 2023-03-22 113023.jpg

 

 

I've tried this. But it will only provide me a list with all the start and end dates. I'm trying to find a solution that also adds all the in between dates.

Oh, I see. You would need to generate a list of dates and merge to the table somehow to fill the gaps. Depending on what you want to do, there might be a better way to get the dates without having to materialize them. E.g. use a detatched calendar and dax if you want to count or sumarize within periods. This way you can drag the Date column from the Calendar table and the measure from the project table into a visual:

Count projects = 
CALCULATE (
    sumx(
        DISTINCT('I have this data'[Project]),1
    ),
        FILTER (
            'I have this data',
            'I have this data'[dEnd] > MAX ( Calendar[Date] )&&
            'I have this data'[dStart] <= MAX ( Calendar[Date])
        )
)



Screenshot 2023-03-22 120405.jpg

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.