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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
Dadoge
Frequent Visitor

Multiple Counting with a date range criteria

Hello,

 

I'm dealing with a scenario where I have a table named "Table 1" with project ID, start date, and end date columns. 

 

What I aim to achieve is to count ongoing projects for each month within a list of dates between 2020 and 2023 (that doesnt exist). I want to create a line chart visual which display the number of ongoing project monthly for the past 3 years.

 

For example, if Project ID number 123456  has a start date of 01/01/2020 and an end date of 01/04/2020, I want to count it as an ongoing project in the line chart for the months 01/2020, 02/2020, 03/2020, and 04/2020 (So for each month there should be a count of 1 because ofthis project)

 

Thanks in advance,

 

7 REPLIES 7
Ashish_Mathur
Super User
Super User

Hi,

Share some data to work with and show the expected result in a Table format.  Share data in a format that can be pasted in an MS Excel file.


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

ID          Start Date     End Date 

101/01/202402/07/2024
220/08/202004/07/2023
330/10/202101/01/2022
423/12/202204/05/2023

 

As for the expected results I want to have a line chart that shows the number of ongoing project per month. Each project will be counted on going for each month between their start date and end date.

 

 

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1713350516110.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-tianyich-msft
Community Support
Community Support

Hi @Dadoge ,

 

I just made a similar requirement, you can refer to this link:Calculate sum() according to a date range - Microsoft Fabric Community, if still in doubt please provide sample data to better solve your problem.

 

Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

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

Hello,

 

thank you for your answer but it unfortunately doesnt work for me.

 

Here is the data set

 

IDStart DateEnd Date 

101/01/202402/07/2024
220/08/202004/07/2023
330/10/202101/01/2022
423/12/202204/05/2023

Hi @Dadoge ,

 

Depending on the requirement you may also have a date sheet, what I have done is to operate on the same date sheet and you can check the result as below:

vtianyichmsft_1-1713344601668.png

 

vtianyichmsft_2-1713344621027.png

Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

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

 

 

Thanks for your quick answer !

What i meant with the expected results is that with your data set, there should be a spike for each month between  2020-08-20 and 2023-07-04. 

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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