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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Jenna619
Regular Visitor

Need help creating a Measure with AverageIf function

I have 'Roster' with employee data. I have it reported weekly but also have 'Roster' [Month] so I can group by month. I need the average count of FT employees by month.

 

I got the first part of the equation, CALCULATE(COUNTA('Rosters'[WorkerType]),'DTS_Rosters'[WorkerType] IN { "FTE" }) 

But I need it to divide by the count of weeks in that month (4/4/5 weeks per month)

 

I created column 'Rosters'[WeekCountbyMonth] so each line has the 4 or 5 that it needs to divide (or for current week it could be 1-5 depending where in the month we are) by. In excel this would be super easy and I would do averageif equal to month but I can't figure it out in PowerBI. I am still new to PowerBI and it has been a steep learning curve but I can't seem to find a forum post asking for similar.

 

 

Current Measure that isn't working but is the closest I have been able to get so far

Avg FT Employees =
CALCULATE(COUNTA('Rosters'[WorkerType]),'Rosters'[WorkerType] IN { "FTE" }) /
AVERAGEX(KEEPFILTERS(VALUES('Rosters'[Month])),CALCULATE(AVERAGE('Rosters'[WeekCountbyMonth])))

1 ACCEPTED SOLUTION
Jenna619
Regular Visitor

I was able to solve my own question. Figured I would post in case in benefits anyone else:

 

Avg FT Employees =
CALCULATE(  COUNTA('Rosters'[WorkerType]),'Rosters'[WorkerType] IN { "FTE" }) /
DIVIDE(SUM('Rosters'[WeekCountbyMonth]),COUNTA(Rosters[WeekCountbyMonth]))

View solution in original post

1 REPLY 1
Jenna619
Regular Visitor

I was able to solve my own question. Figured I would post in case in benefits anyone else:

 

Avg FT Employees =
CALCULATE(  COUNTA('Rosters'[WorkerType]),'Rosters'[WorkerType] IN { "FTE" }) /
DIVIDE(SUM('Rosters'[WeekCountbyMonth]),COUNTA(Rosters[WeekCountbyMonth]))

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.