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, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply

I want to create a Calculated Column to find next Business Days

I have a column which says whether it is a Business Day or Non Business Day

I have labelled Days of the week as follows:

Sun =1

Mon =2

Tues = 3

Wed = 4

Thur = 5

Fri = 6

Sat = 7

 

 

I need to Calculate below colums using Approved PO Date as shown in Table Below

For Eg. Selection of Bidders in table below should be after 1 Business Date from Approved PO Date

Technical Evaluation should be after 2 Business Days from Selection of Bidders Date and so on..

Note: If any date comes on a Non Business Date then it should consider the next Business Date

 

 

My Business Days are from Sunday to Thursday and Non Business Days are Friday and Saturday

 

PO NumberApproved PO DateSelection of BiddersTechnical EvaluationBidder Response Time DOF Approval
PO-2021-00629/06/2021Approved PO Date +1 Business DaySelection of Bidders + 2 Business DaysTechnical Evaluation + 10 Business DaysBidders Response Time + 4 Business Days 

 

 

Can anyone help me regarding this?

 

 

Thanks in Advance!

1 ACCEPTED SOLUTION

Hi @vrushabjain510 ,

 

I did a test and need to create a calendar from Sunday to Thursday. Then according to the approve po data to obtain the corresponding business day, refer to the following:

IsWorkday = IF(WEEKDAY([Date],2)>5,0,1)
Sum = 
VAR _sum =
    SUMX (
        FILTER ( ALL ( 'Calendar' ), [Date] <= EARLIER ( 'Calendar'[Date] ) ),
        [IsWorkday]
    )
RETURN
    IF ( [IsWorkday] = 0, BLANK (), _sum )

 

vhenrykmstf_2-1625129373320.pngvhenrykmstf_0-1625129227802.png

 

PO Date + 1 = 
var _sum=RELATED('Calendar'[Sum])
return
CALCULATE(MAX('Calendar'[Date]),FILTER(ALL('Calendar'),[Sum]=_sum+1))

vhenrykmstf_1-1625129282994.png


Best Regards,
Henry

 

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

 

Below is the sample pbix file.

View solution in original post

8 REPLIES 8
v-henryk-mstf
Community Support
Community Support

Hi @vrushabjain510 ,

 

For the information you gave, refer to the screenshot below, do I understand what you mean correctly? Find the corresponding business day in each column according to Approve PO date.

vhenrykmstf_0-1625123767722.png

 

If not, please further clarify your needs, provide corresponding test data or screenshots of expected results, I will answer you as soon as possible.

 

Best Regards,
Henry

 

Yes,  the screenshot is exactly what I am looking for

Hi @vrushabjain510 ,

 

Do you want to create the next four columns?

Best Regards,
Henry

Hi Henry,

Yes I need to create next four calcuated columns

 

 

Thanks & Regards,

Vrushab 

Hi @vrushabjain510 ,

 

I did a test and need to create a calendar from Sunday to Thursday. Then according to the approve po data to obtain the corresponding business day, refer to the following:

IsWorkday = IF(WEEKDAY([Date],2)>5,0,1)
Sum = 
VAR _sum =
    SUMX (
        FILTER ( ALL ( 'Calendar' ), [Date] <= EARLIER ( 'Calendar'[Date] ) ),
        [IsWorkday]
    )
RETURN
    IF ( [IsWorkday] = 0, BLANK (), _sum )

 

vhenrykmstf_2-1625129373320.pngvhenrykmstf_0-1625129227802.png

 

PO Date + 1 = 
var _sum=RELATED('Calendar'[Sum])
return
CALCULATE(MAX('Calendar'[Date]),FILTER(ALL('Calendar'),[Sum]=_sum+1))

vhenrykmstf_1-1625129282994.png


Best Regards,
Henry

 

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

 

Below is the sample pbix file.

Hi Henry,

Thanks for the solution. This works perfectly

Appreciate your time and efforts!

 

Thanks Henry.

I will test it and let you know soon. 

 

Cheers!

Hi @vrushabjain510 ,

 

If the problem has been solved, you can mark the correct response as a standard answer to help the other members find it more quickly.😊

Best Regards,
Henry

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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