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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
draxicle1
Helper I
Helper I

Measure for Start and End Dates - Days Assigned Graph

Dear PBI community,

 

I have a Power Bi Measure question which I have seen called the “Events in Progress” problem. I've researched and tried to adapt various solutions I've found on this, but none quite fit my scenario. I am fairly new to Power BI and DAX so would appreciate any responses.

 

(This is a simplified version of my real world problem)

 

I have a table called P6_Planned, which is a list of activities, and a separate date table called CalendarTable.

 

P6_Planned contains columns called Activities (a line item name), Start (date), Finish (date), and a sum of Days Assigned (Finish - start +1). The dates are connected to the CalendarTable.

 

I am trying to create a measure that looks at a date and sums all the Days Assigned across ALL the activities, and takes into account the cumulative effect of overlaps. With this measure I would like to plot a graph with x-axis being dates and y-axis showing how many assigned days there are across all activities

 

I have a attached an illustration of what I’m trying to achieve. (Not sure how to attach the pbix file to this post.)

Events in Progress Visual.png

Thanks in anticipation!

1 ACCEPTED SOLUTION
v-jialongy-msft
Community Support
Community Support

Hi @draxicle1 

 

Try the following measure

Measure = 
SUMX(
    CalendarTable,
    CALCULATE(
        COUNTROWS(P6_Planned),
        FILTER(
            P6_Planned,
            P6_Planned[Start] <= CalendarTable[Date]
            && P6_Planned[Finish] >= CalendarTable[Date]
        )
    )
)

 

This is the result you want

vjialongymsft_0-1706840703461.png

 

 

Best Regards,

Jayleny

 

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

2 REPLIES 2
v-jialongy-msft
Community Support
Community Support

Hi @draxicle1 

 

Try the following measure

Measure = 
SUMX(
    CalendarTable,
    CALCULATE(
        COUNTROWS(P6_Planned),
        FILTER(
            P6_Planned,
            P6_Planned[Start] <= CalendarTable[Date]
            && P6_Planned[Finish] >= CalendarTable[Date]
        )
    )
)

 

This is the result you want

vjialongymsft_0-1706840703461.png

 

 

Best Regards,

Jayleny

 

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

This is great. Thank you so much for your time. I have replicated this is my main model.

 

The only fly in the ointment (I learned from a recent meeting) is that I made the assumption that every day between the start and finish is actively being used on every activity in the list. Apparently there will be a new column that shows the amount of time (effort in hours)  used between those dates.  So I guess if you had 10 days duration, but only 24 hours of actual effort spread across those, you would have an average 2.4 hours showing every day.

 

Perhaps that's one for another post.

 

Thanks all the same.

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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