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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
MariDR
New Member

Computing how many projects are open in any given month (with start and end dates)

Hello! I am trying to compute how many projects are open in any given month based on start and end dates. I have a dynamic date table, and a main table with project ID (distinct), project owner (one project owner may have multiple projects), start date and end date. 

 

Project OwnerProject IDStart DateEnd Date
John A01235/1/20248/31/2024
John A123407/1/202410/1/2024
Mel A23454/1/20247/15/2024
Mel B34566/1/20249/1/2024

 

How do I go about with using a measure so that end product looks like the below table. Thanks in advance!

 

Project OwnerAPR 2024MAY 2024JUN 2024JUL 2024AUG 2024SEP 2024OCT 2024
John A 112211
Mel B112211 
3 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@MariDR , Please follow the approach of give HR blog and file with a date table

 

Power BI: HR Analytics - Employees as on Date : https://youtu.be/e6Y-l_JtCq4
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
Power BI HR Active Employee Tenure Bucketing, and Hired, Terminated, and Active employees: https://youtu.be/fvgcx8QLqZU

 

 

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

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

I have solved a similar problem in the attached PBI file.

Hope this helps.

Ashish_Mathur_0-1721271809687.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

I have solved a similar problem in the attached PBI file.

Hope this helps.

Ashish_Mathur_0-1721271809687.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi all,thanks for the quick reply, I'll add more.

Hi @MariDR ,

The Table data is shown below:

vzhouwenmsft_0-1721025512599.png

Please follow these steps:

1.Use the following DAX expression to create columns in 'Table'

Column = 
VAR _start = YEAR([Start Date]) * 100 + MONTH([Start Date])
VAR _end = YEAR([Start Date]) * 100 + MONTH([End Date])
VAR _table = GENERATESERIES(_start,_end,1)
VAR _table2 = CONCATENATEX(_table,[Value])
RETURN _table2
Column 2 = CALCULATE(CONCATENATEX('Table',[Column]),ALLEXCEPT('Table','Table'[Project Owner]))

vzhouwenmsft_3-1721025729991.png

2.Use the following DAX expression to create a table named 'Calendar'

Calendar = 
ADDCOLUMNS(CALENDAR(DATE(2023,1,1),DATE(2024,12,31)),
"Month",YEAR([Date]) & SWITCH(TRUE(),
                              MONTH([Date]) = 1, "Jan",
                              MONTH([Date]) = 2, "Feb",
                              MONTH([Date]) = 3, "Mar",
                              MONTH([Date]) = 4, "Apr",
                              MONTH([Date]) = 5, "May",
                              MONTH([Date]) = 6, "Jun",
                              MONTH([Date]) = 7, "Jul",
                              MONTH([Date]) = 8, "Aug",
                              MONTH([Date]) = 9, "Sep",
                              MONTH([Date]) = 10, "Oct",
                              MONTH([Date]) = 11, "Nov",
                              MONTH([Date]) = 12, "Dec"
                            ),
"MonthNumber",YEAR([Date]) *100 + MONTH([Date])
)

vzhouwenmsft_2-1721025647847.png

3.Use the following DAX expression to create a measure

Measure = 
VAR _MothNumber = SELECTEDVALUE(Calendar[MonthNumber])
VAR _len = LEN(MAX('Table'[Column 2]))
VAR _table = ADDCOLUMNS(GENERATESERIES(1,_len,6),"Month",MID(MAX('Table'[Column 2]),[Value],6))
RETURN COUNTROWS(FILTER(_table,[Month] = _MothNumber & ""))

4.Final output

vzhouwenmsft_4-1721025817524.png

 

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

BITomS
Solution Supplier
Solution Supplier

Hi @MariDR,

 

I think article tutorial help: https://community.fabric.microsoft.com/t5/Desktop/Tutorial-Fill-All-Dates-Between-Start-Date-and-End...

 

Once you extrapolate the dates between start and end into a single column, you can add month and year columns into your table and create a measure to identify distinct month/year combinations each project exists in.

 

Hope this helps!

JinDR
Frequent Visitor

Thank you for this link. I was able to use the M method successfully and then connected it with a date table. I was wondering though if would it be possible to do the same list by month instead of by day? TIA.

BITomS
Solution Supplier
Solution Supplier
amitchandak
Super User
Super User

@MariDR , Please follow the approach of give HR blog and file with a date table

 

Power BI: HR Analytics - Employees as on Date : https://youtu.be/e6Y-l_JtCq4
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
Power BI HR Active Employee Tenure Bucketing, and Hired, Terminated, and Active employees: https://youtu.be/fvgcx8QLqZU

 

 

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
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.