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
awitt
Helper III
Helper III

Date Add With Working Day

Im looking to return a date that is a certain number of working days after a date in a date table. My date table has a record for each day and does already have a correct working day column. In this case I want a column that has 4 working days after each date represented. Any thoughts would be appreciated!

2 REPLIES 2
AlB
Super User
Super User

Hi @awitt 

A bit of  a convoluted solution. I'm sure it can be done more efficiently and simply. It's a calculated column in your table, Table1, where Table1[Date] is the column you'd what to add the working days too.

Calc colum =
VAR daysToAdd_ = 4 //update as required
RETURN
    MAXX (
        TOPN (
            daysToAdd_,
            CALCULATETABLE (
                DISTINCT ( CalendarTable[Date] ),
                CalendarTable[Date] > Table1[Date],
                CalendarTable[WorkingDay] = "Yes"
            ),
            CalendarTable[Date], ASC
        ),
        CalendarTable[Date]
    )

 

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

Greg_Deckler
Super User
Super User

@awitt - So perhaps something like this:

 

Column = 
  VAR __Date = 'Calendar'[Date]
  VAR __Dates = 
    ADDCOLUMNS(
      CALENDAR(__Date,__Date + 4),
      "Workday",WEEKDAY([Date],2)
    )
RETURN
  MAXX(FILTER(__Dates,[Workday] < 6),[Date]) + COUNTROWS(FILTER(__Dates,[Workday] > 5))

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.