cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

ADD or MINUS NUMBER OF WORKING DAYS FROM A DATE

Hi guys,

 

I am new to Power Bi, hoping someone will be able to assist me. I am trying to add (and remove- in another report) a number of working days from a date. I have a date table already and a workday column. Below is logic in excel, trying to convert this into DAX:

Mugisha_0-1596439135023.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: ADD or MINUS NUMBER OF WORKING DAYS FROM A DATE

Hi @Mugisha ,

 

Has your problem been solved?

Please refer to my .pbix file.

 

v-lionel-msft_0-1597997425061.png

 

Best regards,
Lionel Chen

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

View solution in original post

5 REPLIES 5
Highlighted
Super User IV
Super User IV

Re: ADD or MINUS NUMBER OF WORKING DAYS FROM A DATE

@Mugisha , refer this

Travelling Across Workdays - Decoding Date and Calendar 4-5 - Power BI Turning 5 Celebration Series
https://community.powerbi.com/t5/Community-Blog/Travelling-Across-Workdays-Decoding-Date-and-Calenda...



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Highlighted
Super User IV
Super User IV

Re: ADD or MINUS NUMBER OF WORKING DAYS FROM A DATE

@Mugisha - See if this helps, it was written as a replacement for Excel NETWORKDAYS: https://community.powerbi.com/t5/Quick-Measures-Gallery/Net-Work-Days/td-p/367362

 

Also, see this more general Excel to DAX Translation page: https://community.powerbi.com/t5/Community-Blog/Excel-to-DAX-Translation/ba-p/1060991


---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




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

Proud to be a Super User!




Highlighted
Community Support
Community Support

Re: ADD or MINUS NUMBER OF WORKING DAYS FROM A DATE

Hi @Mugisha ,

 

v-lionel-msft_0-1596519010058.png

Why are the start date and end date in the NETWORKDAYS function the same?

You may meed to create a measure like this.

Measure = 
IFERROR(
    SWITCH(
        TRUE(),
        MAX([Expiry Indicator]) = "No Expiry Date", BLANK(),
        DATEDIFF( ) = 0, DATEADD(Sheet5[Tenancy Expiry Date], -20, DAY),
        DATEDIFF( ) = 1, DATEADD(Sheet5[Tenancy Expiry Date], -19, DAY)
    ),
    "Check"
)

Please give a sample data of the table if you cant get the correct result and explain your calculation logic again.

 

Best regards,
Lionel Chen

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

Highlighted
Community Support
Community Support

Re: ADD or MINUS NUMBER OF WORKING DAYS FROM A DATE

Hi @Mugisha ,

 

Has your problem been solved?

Please refer to my .pbix file.

 

v-lionel-msft_0-1597997425061.png

 

Best regards,
Lionel Chen

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

View solution in original post

Highlighted
Frequent Visitor

Re: ADD or MINUS NUMBER OF WORKING DAYS FROM A DATE

😁 Thank you!!!!!!

Helpful resources

Announcements
Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors