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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
jabbajuice08
Frequent Visitor

Distributing total duration for a task throughout multiple months

I need to create a bar graph that needs to add up all the total durations within each month. So each bar represents a different month and year combination (we have our own specific accounting calendar- JAN 2022, FEB 2022, etc, etc) that I use as a reference and have within my report).  

 

So for example, a task starts 1/1/2022 and ends 3/5/2022 and has a total duration of 64 days in the 'TOTAL DURATION' column.

For our accounting calendar, JAN 2022 would be from 1/1/2022-1/28/2022 and FEB 2022 would be from 1/29/22-1/28/22. My calendar table has the DATELABEL, DATESTART, and DATEFINISH columns. So that task would have 28 days within JAN (and then weekends would have to be subtracted), 31 days in FEB, and 5 days in March. The same thing would go for every single task, and the bar graphs would have those overall counts for each accounting month/year. 

 

I have no idea how to tackle this problem. I work in an environment where I can't share my powerbi report, so unfortunately I can't share any sample report. If anyone would help, it would be much appreciated!

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @jabbajuice08 

 

I have attached a sample file at bottom for your reference. It has two examples, one including weekends and the other excluding weekends. Hope it helps. 

vjingzhang_0-1670570272706.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

3 REPLIES 3
v-jingzhang
Community Support
Community Support

Hi @jabbajuice08 

 

I have attached a sample file at bottom for your reference. It has two examples, one including weekends and the other excluding weekends. Hope it helps. 

vjingzhang_0-1670570272706.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

@v-jingzhang Thank you! This worked perfectly for me. Only question...if my calendar table works like this: 

jabbajuice08_0-1671048491354.png

where I have ranges of dates to signify which month it falls in, instead of using a calendar where it has each, individual date, how would I go about using those same formulas? 

 

Hi @jabbajuice08 

 

Your date table is not a standard date table, so I would suggest that you convert it into a standard date table which will make further calculation easier. Do You Need a Date Dimension? - RADACAD

 

You can use Power Query Editor to transform the current table. First add a custom column with 

List.Dates([MonthStartDate],Duration.Days([MonthEndDate]-[MonthStartDate])+1,#duration(1,0,0,0))

vjingzhang_1-1671182163972.png

 

Then expand this list column to new rows. You will transform the table into below. Rename the column "Custom". This column has individual dates in every range. 

vjingzhang_2-1671182255711.png

 

Best Regards,
Community Support Team _ Jing

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors