cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
android1 Member
Member

Calculating Average YTD

Hi,

 

I want to calculate the average hours worked by Carer YTD . I am using the measure TotalHours average per CarerName =
AVERAGEX(
KEEPFILTERS(VALUES('vw_PivotWagesHrs'[CarerName])),
CALCULATE(SUM('vw_PivotWagesHrs'[TotalHours]))

 

This gives me what I want if I choose a particular week from a slicer. (TotalHours/Count of Carers)

 

 Avg Hrs.jpg

 

Problem is when I don't have a Week selected. I get:

 

Avg Hrs 2.jpg

 

So it's only dividing TotalHours (303.69 for e.g) by 13 when it should be sum of count of carers.

 

How do I account for this in my measure?

 

Thanks,

 

Gerry

1 REPLY 1
v-ljerr-msft Super Contributor
Super Contributor

Re: Calculating Average YTD

Hi @android1,


So it's only dividing TotalHours (303.69 for e.g) by 13 when it should be sum of count of carers.


I'm not sure I understand your requirement totally. So the expected result(303.69 for e.g) should be 3947.98/(13+16+22+23+24+26+27) ?

 

In addition, could you also post your real table structures with some sample data? So that we can better assist on this issue. Smiley Happy

 

Regards

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and 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.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 268 members 3,156 guests
Please welcome our newest community members: