cancel
Showing results for
Did you mean:
Frequent Visitor

## NETWORKDAYS inside PowerBI

There are two columns, Void Start and Due Date, I would like to work out the number of working days between the two days.

I've tried to use the following formula shown here (by @Greg_Deckler ), but I can't seem to get it to work.

This is the code for my situation (created it as a measure):

```NetWorkDays =
VAR Calendar1 = CALENDAR(MAX('Voids Data'[Void Start]),MAX('Voids Data'[Due Date (corrected)]))
RETURN COUNTX(FILTER(Calendar2,[WeekDay]<6),[Date])```

It's accepted by PowerBI, but when I throw it into a table visualisation (this visualisation has two columns, one is void start date, the other is due date), I get the following error:

1 ACCEPTED SOLUTION

Accepted Solutions
Frequent Visitor

## Re: NETWORKDAYS inside PowerBI

So I kept playing around with different solutions but the original solution provided by @Greg_Deckler seemed to work once I removed null values from my data and then made the extreme values zero:

```VAR Calendar1 = CALENDAR(MIN('Voids Data'[Start]),MIN('Voids Data'[End]))
RETURN IF(COUNTX(FILTER(Calendar2,[WeekDay]<6),[Date])>1000,0,COUNTX(FILTER(Calendar2,[WeekDay]<6),[Date]))```
3 REPLIES 3
Frequent Visitor

## Re: NETWORKDAYS inside PowerBI

So I kept playing around with different solutions but the original solution provided by @Greg_Deckler seemed to work once I removed null values from my data and then made the extreme values zero:

```VAR Calendar1 = CALENDAR(MIN('Voids Data'[Start]),MIN('Voids Data'[End]))
RETURN IF(COUNTX(FILTER(Calendar2,[WeekDay]<6),[Date])>1000,0,COUNTX(FILTER(Calendar2,[WeekDay]<6),[Date]))```
Community Support Team

## Re: NETWORKDAYS inside PowerBI

Hi raeesgillani,

Could you please tell us if your problem has been solved? If you have any problem, please feel free to tell me.

Best Regards,

Teige

Frequent Visitor

## Re: NETWORKDAYS inside PowerBI

Yes the issue was resolved, thank you for the check

Announcements

#### Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

#### Community News & Announcements

Get your latest community news and announcements.

#### Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

#### Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Top Kudoed Authors
Users Online
Currently online: 109 members 1,562 guests
Recent signins: