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
StuartSmith
Power Participant
Power Participant

Networkdays - Use todays date if 2nd date is empty.

I have the below measure that works out the week days between 2 days, but sometimes the 2nd date (position filled date), wont have a value, so how can I modify the below measure so that if the 2nd data parameter of "NETWORKDAYS" is blank, it uses todays date?

 

Weekdays = NETWORKDAYS('KPI Measures: Time to Fill'[(1) Position End Date], 'KPI Measures: Time to Fill'[(2) Position Filled Date]) +0
 
Thanks in advance,
5 REPLIES 5
StuartSmith
Power Participant
Power Participant

Can anyone help with this?

I ended up using "

PositonFilledWithTodayIfBlank = IF ('User Archive'[Position Filled] = blank(), today(), 'User Archive'[Position Filled] )" to create a new column and used this.
Greg_Deckler
Community Champion
Community Champion

@StuartSmith Try:

Weekdays = 
  VAR __StartDate = 'KPI Measures: Time to Fill'[(1) Position End Date]
  VAR __End = 'KPI Measures: Time to Fill'[(2) Position Filled Date]
  VAR __EndDate = IF( __End = BLANK(), TODAY(), __End)
  VAR __Result = NETWORKDAYS( __StartDate, __EndDate) +0
RETURN
  __Result


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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler  @rajendraongole1 
This solution didn't work with me, as print below:

wendereis_0-1719420065767.png

 

Thanks, and your code makes perfect sense.  I must learn to breakdown the solution into smaller chunks.  That said, by adding the line that checks if the "Positon Filled" value is Blank, its doing something odd and creating lots more rows.  I have been able to replicate with dummy data and you can view a .pbix file below.

Time to Fill Position Filled Checker The file contains 2 tables visuals, 1 without th line to check if blank and 1 with.

Thanks in advance,

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