cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jamecl Frequent Visitor
Frequent Visitor

Calculating Number of Workdays for Each Month, use result to divide the result of another measure

I have the following calendar table where I have the working days per month. I want to get the total work days per month and use that value in another measure.

 

To give you some background, I'm dividing the number of estimated work days to complete a project by the number of work days in a month to get the number of resources needed for the next year. I know it can't be that difficult, but I'm fairly new to Power BI.

 

 

Power BI Table Desktop.png 

1 ACCEPTED SOLUTION

Accepted Solutions
rafaelmpsantos Established Member
Established Member

Re: Calculating Number of Workdays for Each Month, use result to divide the result of another measur

In dax you may create a newcolum and use this

WorkDayMOnth = 
var month = month(dimCalendar[Date])
var year = year(dimCalendar[Date])
return
CALCULATE(COUNT(dimCalendar[Date]),filter(all(dimCalendar[Date]),YEAR(dimCalendar[Date])=year && MONTH(dimCalendar[Date])=month && WEEKDAY(dimCalendar[Date]) in {2,3,4,5,6}))
2 REPLIES 2
rafaelmpsantos Established Member
Established Member

Re: Calculating Number of Workdays for Each Month, use result to divide the result of another measur

In dax you may create a newcolum and use this

WorkDayMOnth = 
var month = month(dimCalendar[Date])
var year = year(dimCalendar[Date])
return
CALCULATE(COUNT(dimCalendar[Date]),filter(all(dimCalendar[Date]),YEAR(dimCalendar[Date])=year && MONTH(dimCalendar[Date])=month && WEEKDAY(dimCalendar[Date]) in {2,3,4,5,6}))
jamecl Frequent Visitor
Frequent Visitor

Re: Calculating Number of Workdays for Each Month, use result to divide the result of another measur

Thank you.

 

How do I account for holidays in the column? The 'Work Time' column designates work days - 1 for a work day 0 for holiday or weekend.

 

Also, I need to take the value in the WorkDayMonth column and divide it into a measure -  I'm not quite sure how to do that.

 

Here is the measure I'm working with - 

AvailabilityDays = Divide(SUM(Availability[Capacity])-(SUM('Engagements By Day'[Engagement Total Work])+sum('Assignments By Day'[Assignment Total Work])),6.8) / "number of working days"

Helpful resources

Announcements
Virtual Launch Event

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.

Power BI Helps Homeless and Trouble Youth

Power BI Helps Homeless and Trouble Youth

We spoke with Power BI Super User, Greg Deckler, about his charity work

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 259 members 3,131 guests
Please welcome our newest community members: