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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
PaulMac
Helper IV
Helper IV

Converting a simple Formula to Work in Power BI

Hi

 

We have a very simple formula in an Excel workbook:

 

=WORKDAY($A2,9,BankHolidays)

 

This takes the date that sits in cell A2, adds on 9 working days, excluding any Bank Holiday dates that are present in the BankHolidays table. Simple.

But trying to accomplish the same thing in Power BI using DAX or M Lang is not so simple, at least from what I am finding.

I have tried to produce the following DAX but unfortnately I get a widly incorrect date.

 

10 Day Letter Due =
NETWORKDAYS (
    table1[Date Received],
    DATEADD ( table1[Date Received], 9, DAY ),
    1,
    tblPublicHolidayDates
)

 

If anyone is able to assist with a simple and ellgant solution to this, it would be very much appreciated.

Thanks,
Paul

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@PaulMac,

 

Try this calculated column in Table1. It requires a Dates table with columns Is Weekday and Is Holiday.

 

10 Day Letter Due =
VAR vDaysToAdd = 9
VAR vStartDate =
    Table1[Date Received]
VAR vWorkdaysAfterStartDate =
    FILTER (
        Dates,
        Dates[Date] > vStartDate
            && Dates[Is Weekday] = 1
            && Dates[Is Holiday] = 0
    )
VAR vResult =
    MAXX (
        TOPN ( vDaysToAdd, vWorkdaysAfterStartDate, Dates[Date], ASC ),
        Dates[Date]
    )
RETURN
    vResult

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
PaulMac
Helper IV
Helper IV

Thank you @DataInsights 
That did the job perfectly!
Paul

DataInsights
Super User
Super User

@PaulMac,

 

Try this calculated column in Table1. It requires a Dates table with columns Is Weekday and Is Holiday.

 

10 Day Letter Due =
VAR vDaysToAdd = 9
VAR vStartDate =
    Table1[Date Received]
VAR vWorkdaysAfterStartDate =
    FILTER (
        Dates,
        Dates[Date] > vStartDate
            && Dates[Is Weekday] = 1
            && Dates[Is Holiday] = 0
    )
VAR vResult =
    MAXX (
        TOPN ( vDaysToAdd, vWorkdaysAfterStartDate, Dates[Date], ASC ),
        Dates[Date]
    )
RETURN
    vResult

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Top Kudoed Authors