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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
JovieZ
New Member

Calculate working days between two dates

Hi everyone,

 

I have two date columns in Power BI (Site Version Date, Country Version Date). How should I calculate the number of working days between these two columns? Thank you!

JovieZ_0-1722924057259.png

JovieZ_1-1722924084042.png

I also set up a calendar table but I'm not sure if this table is neccessary.

JovieZ_2-1722924127954.png

 

 

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@JovieZ , First create a date table using below DAX go to modelling click on new table

DateTable =
ADDCOLUMNS (
CALENDAR (MIN('YourTable'[Site Version Date]), MAX('YourTable'[Country Version Date])),
"IsWorkingDay",
IF (
WEEKDAY ( [Date], 2 ) < 6,
TRUE,
FALSE
)
)

 

Mark this table as date table

 

Then create a calculated column in your main table using

WorkingDaysBetween =
VAR StartDate = 'YourTable'[Site Version Date]
VAR EndDate = 'YourTable'[Country Version Date]
RETURN
CALCULATE (
COUNTROWS ( DateTable ),
DateTable[Date] >= StartDate,
DateTable[Date] <= EndDate,
DateTable[IsWorkingDay] = TRUE
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

2 REPLIES 2
Dangar332
Super User
Super User

Hi, @JovieZ 

You can use Networkday() Function

use Below measure

Measure =
Networkday(min(table[Country Version Date]),min(table[Site Version Date]),1)


You can refer Networkday() function from LINK 

bhanu_gautam
Super User
Super User

@JovieZ , First create a date table using below DAX go to modelling click on new table

DateTable =
ADDCOLUMNS (
CALENDAR (MIN('YourTable'[Site Version Date]), MAX('YourTable'[Country Version Date])),
"IsWorkingDay",
IF (
WEEKDAY ( [Date], 2 ) < 6,
TRUE,
FALSE
)
)

 

Mark this table as date table

 

Then create a calculated column in your main table using

WorkingDaysBetween =
VAR StartDate = 'YourTable'[Site Version Date]
VAR EndDate = 'YourTable'[Country Version Date]
RETURN
CALCULATE (
COUNTROWS ( DateTable ),
DateTable[Date] >= StartDate,
DateTable[Date] <= EndDate,
DateTable[IsWorkingDay] = TRUE
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.