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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors