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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Help with Date calculations and count of days

Hi Team,

I am new to BI and needed quick help to achieve the highlighted columns from the data set below. I have provided the intended outcomes in the last two columns in Blue.

 

Data set help.PNG

 

Thanks in advance!

1 ACCEPTED SOLUTION
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous ,

Based on my test, you could refer to below steps:

Create a weeknum column:

weekday = WEEKDAY('Table1'[Date of delivery],2)

Create two columns:

Column = [Date of delivery]+ROUNDDOWN('Table1'[SLA]/5,0)*5+ROUNDUP('Table1'[SLA]/5,0)*2+MOD('Table1'[SLA],5)
Actual days = DATEDIFF('Table1'[Date of delivery],[Column],DAY)

Result:

1.PNG

You could also download the pbix file to have a view.

 

Regards,

Daniel He

 

Community Support Team _ Daniel He
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-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous ,

Based on my test, you could refer to below steps:

Create a weeknum column:

weekday = WEEKDAY('Table1'[Date of delivery],2)

Create two columns:

Column = [Date of delivery]+ROUNDDOWN('Table1'[SLA]/5,0)*5+ROUNDUP('Table1'[SLA]/5,0)*2+MOD('Table1'[SLA],5)
Actual days = DATEDIFF('Table1'[Date of delivery],[Column],DAY)

Result:

1.PNG

You could also download the pbix file to have a view.

 

Regards,

Daniel He

 

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @v-danhe-msft ,

 

Thank you very much for your help. Yes! This is exactly what I was trying to achieve! However, I noticed the 'Actual days' field doesn't exclude weekends. I couldn't proceed further as I also have some other columns and measures to apply based on these values available. Could you please review it once more?

 

I have attached the screenshot again for your easy reference purpose. Many thanks for your quick help.Data set help.PNG

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.