I have two dates columns and I want to calculate the number of working days between those two dates? like network days in excel.
How can we do this here in power BI?
Go to Solution.
Assume you have a dataset as below. We can create a calendar table and add a column in it to mark the working days. Then create a column in NetWorkDays table to show the number of working days.
CALENDAR ( MIN ( NetWorkDays[Start date] ), MAX ( NetWorkDays[End date] ) )
VAR WeekDayNum =
WEEKDAY ( DimDate[Date] )
OR ( WeekDayNum = 1, WeekDayNum = 7 ),
RELATED ( Holidays[Date] ) <> BLANK ()
DimDate[Date] >= NetWorkDays[Start date],
DimDate[Date] <= NetWorkDays[End date]
View solution in original post
Please have alook at this, it may answer your question:
Can you try something like:
When creating a new column using the below code, this method equates to an #ERROR (see attached screenshot)
Why doesn't it like these columns? Just because they are not DAX!!??Frustrating that forum user examples vary from what can actually be done in Power BI
Were your columns on the 'NetworkDays' table named [Start Date] & [End Date] DAX/Measures?
Is there any reason why I can only choose measures?
Kudos to you if you earned one of these! Check your inbox for a notification.
Learn about the award-winning innovation that was implemented across Microsoft’s Business Applications Communities.
Find out where you can attend!