cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Function that returns next business day based on today's date

Example: Today is 05/29, the function should return the next working day will be 06/01.

 

Does anyone have any idea how this can be done in dax?

 

thank you

2 REPLIES 2
MarcelWoodman
Regular Visitor

I don't factor in Holidays, but for eliminating the weekends:

if(WEEKDAY([date],2)<5,[date] + 1,[date] + (8 - WEEKDAY([date],2)))
AlB
Super User
Super User

Hi @Anonymous 

Probably best to have a calendar table that has a column indicating whether a day is a business day. Then you could obtain the next business date with something like:

 

CALCULATE (
    MIN ( CalendarTable[Date] ),
    FILTER (
        ALL ( CalendarTable[Date], CalendarTable[isBusiness] ),
        CalendarTable[Date] > TODAY ()
            && CalendarTable[isBusiness] = "Yes"
    )
)

 

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

Helpful resources

Announcements
Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!