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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

How to show the network days between two dates if those two dates are weekend dates

Hi Community,

 

I have two date columns which named as End date and Fy Year end.. Now i want to find out network days between those two days for that i used this measure which is giving proper count. See below:

 

NetWorkDaysEND =
VAR Calendar1 = CALENDAR(MIN('Query1'[END]),MAX('Query1'[FYEND]))
VAR Calendar2 = ADDCOLUMNS(Calendar1,"WeekDay",WEEKDAY([Date],2))
RETURN
COUNTX(FILTER(Calendar2,[WeekDay]<=5),[Date])
 
But I am facing one issue here, In my data Couple of End dates and FYEnd dates are same and those dates are Weekend dates. For those dates i am getting blank instead of blank i want 0.
 
What should i modify in my measure
 
Here is my screenshot of that dataCap.JPG

 

Please help me out from this

 

Thanks in advance

 

B V S Sudhakar

 

 
2 ACCEPTED SOLUTIONS
gooranga1
Power Participant
Power Participant

Hi @Anonymous 

 

You could try this amendment to force a zero where blank.

 

NetworkDays.PNG

View solution in original post

Anonymous
Not applicable

Hi @gooranga1,

 

Thank you for your answer.

But for my case i can't write like that so i wrote like this

NetWorkDaysEND =
VAR Calendar1 = CALENDAR(MIN('Query1'[END]),MAX('Query1'[FYEND]))
VAR Calendar2 = ADDCOLUMNS(Calendar1,"WeekDay",WEEKDAY([Date],2))
RETURN
COUNTX(FILTER(Calendar2,[WeekDay]<=7),[Date])- COUNTX(FILTER(Calendar2,[WeekDay]>=6),[Date])
 
This was worked for me

View solution in original post

2 REPLIES 2
gooranga1
Power Participant
Power Participant

Hi @Anonymous 

 

You could try this amendment to force a zero where blank.

 

NetworkDays.PNG

Anonymous
Not applicable

Hi @gooranga1,

 

Thank you for your answer.

But for my case i can't write like that so i wrote like this

NetWorkDaysEND =
VAR Calendar1 = CALENDAR(MIN('Query1'[END]),MAX('Query1'[FYEND]))
VAR Calendar2 = ADDCOLUMNS(Calendar1,"WeekDay",WEEKDAY([Date],2))
RETURN
COUNTX(FILTER(Calendar2,[WeekDay]<=7),[Date])- COUNTX(FILTER(Calendar2,[WeekDay]>=6),[Date])
 
This was worked for me

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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