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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Anonymous
Not applicable

workingdays in measure and not in calculated column

Hi

We have the next calculated column to calculate the count of workingsdays between 2 dates.

 

CALCULATE(
COUNTROWS(Calender),
DATESBETWEEN(Calender[Date],'table1'[first_date],table1'[second_date] -1),
Calender[isworkday] = 1)


Now we want to convert this formula to a measure so we are more flexibel in the calculations. 
maybe something with an averagex?

 

Have someone any idea?

 

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

Based on your description, you have create a column like [IsWorkingDay] using 1 to represent Working Days. You can try DAX formula like below:

 

Measure = CALCULATE(
COUNTROWS('Calender'),
DATESBETWEEN('Calender'[Date],SELECTEDVALUE('Table1'[first_date]),SELECTEDVALUE('Table1'[second_date])-1),
'Calender'[IsWorkDay]= 1)

 

Best Regards,

Liang 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

Based on your description, you have create a column like [IsWorkingDay] using 1 to represent Working Days. You can try DAX formula like below:

 

Measure = CALCULATE(
COUNTROWS('Calender'),
DATESBETWEEN('Calender'[Date],SELECTEDVALUE('Table1'[first_date]),SELECTEDVALUE('Table1'[second_date])-1),
'Calender'[IsWorkDay]= 1)

 

Best Regards,

Liang 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Kudoed Authors