The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I created a measure for networkdays, but when the days for my two fields match, the results aren't giving me 0 days difference, rather it is returning 1 day. The only instance where the result is 0 days is when the days being calculated is during a weekend. Below is the formula.
To bypass this error where 0 days is not in all instances, I created a new column using an IF statement.
Solved! Go to Solution.
Hello @vbatch
NETWORKDAYS effectively counts work days occuring from StartDate to EndDate inclusive.
What is the exact rule you want to apply?
Is it to take the dates from StartDate to EndDate and return the difference between the earliest workday and latest workday?
Do these look correct? Otherwise please update to what you would expect
StartDate | EndDate | Difference | Calculation |
Sun 23 July | Sun 23 July | 0 | No workdays => 0 |
Sun 23 July | Mon 24 July | 0 | 24-Jul - 24-Jul |
Mon 24 July | Mon 24 July | 0 | 24-Jul - 24-Jul |
Mon 24 July | Tue 25 July | 1 | 25-Jul - 24-Jul |
Mon 24 July | Wed 26 July | 2 | 26-Jul - 24-Jul |
Sun 23 July | Sun 30 July | 4 | 28-Jul - 24-Jul |
An expression that would produce the above is:
MAX ( 0, NETWORKDAYS ( <SentDate>, <ContactDate> ) - 1 )
Regards
Hello @vbatch
NETWORKDAYS effectively counts work days occuring from StartDate to EndDate inclusive.
What is the exact rule you want to apply?
Is it to take the dates from StartDate to EndDate and return the difference between the earliest workday and latest workday?
Do these look correct? Otherwise please update to what you would expect
StartDate | EndDate | Difference | Calculation |
Sun 23 July | Sun 23 July | 0 | No workdays => 0 |
Sun 23 July | Mon 24 July | 0 | 24-Jul - 24-Jul |
Mon 24 July | Mon 24 July | 0 | 24-Jul - 24-Jul |
Mon 24 July | Tue 25 July | 1 | 25-Jul - 24-Jul |
Mon 24 July | Wed 26 July | 2 | 26-Jul - 24-Jul |
Sun 23 July | Sun 30 July | 4 | 28-Jul - 24-Jul |
An expression that would produce the above is:
MAX ( 0, NETWORKDAYS ( <SentDate>, <ContactDate> ) - 1 )
Regards
User | Count |
---|---|
13 | |
8 | |
6 | |
6 | |
5 |
User | Count |
---|---|
24 | |
14 | |
13 | |
8 | |
8 |