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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

Change network days using a parameter

Hi All,

 

I'm new to Power Bi Dax and needed some guidance on how we can accomplish the following:

 

ABCDE
ProjectPhasedDate1Date2network Days
1Yes9/23/201912/31/20198
2No12/16/20196/20/2020245
3No9/12/20191/12/2020131

 

=IF(B:B="Yes",NETWORKDAYS(TODAY(),C2),NETWORKDAYS(TODAY(),D2+60))

 

 If phased is "Yes" then choose Date1 as the end date to calculate network days else add the #of days to date2 (I want to able to choose either 60, 90 or 120 days from a slicer. I have manually added 60 in the above example)and calculate the network days between today and the new end date.

 

Any help will be much appreciated.

1 ACCEPTED SOLUTION

@Anonymous you can add flag for weekend in your table and then use that in your measure to filter it out



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

5 REPLIES 5
parry2k
Super User
Super User

@Anonymous 

 

add following measure

 

Network Days =
VAR __phase = MAX( Table[Phased] )
VAR __date = IF( MAX( Table[Phased] ) = "Yes", MAX( Table[Date] ), 
MAX( Table[Date2] ) + SELECTEDVALUE( SlicerTable[SlicerValue] ) )
RETURN
DATEDIFF( TODAY(), __date, DAY )


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

@parry2k 

 

Thanks. It's working partially. Is there a way of removing the weekends?

@Anonymous you can add flag for weekend in your table and then use that in your measure to filter it out



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

@parry2k 

 

I have the flag added to my date table but struggling to add the filter to the measure. Any further help will be much appreciated.

Anonymous
Not applicable

@parry2k 

 

Thanks a lot. I was able to get the desired result.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.