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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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