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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

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
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

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
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

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.

Anonymous
Not applicable

😁 Thank you!!!!!!

v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

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.

Greg_Deckler
Super User
Super User

@Anonymous - 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



Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@Anonymous , 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-Calendar-4-5-Power/ba-p/1187766

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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