Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Measure not calculating on each row

Hi guys,

 

I am trying to calculate the total hours scheduled for each month. To do this I have 1 measure that calculates the amount of active employees, a column with the average hours.

 

Current Employees = CALCULATE(COUNTx(FILTER(Schedules;Schedules[StartDate]<=max('Calendar'[Date]) && (ISBLANK(Schedules[EndDate]) || Schedules[EndDate]>max('Calendar'[Date])));(Schedules[Employment]));CROSSFILTER(Schedules[StartDate];'Calendar'[Date];None))
The average hours can be 12/24/36/40
 
If I try to calculate the total hours it will summarize the average hours and multiply it by the current employees which gives a too large amount.
If I don't summarize the total hours it will only calculate a few random rows.
 
The measure I use is:
Measure = CALCULATE([Current Employees] * SUMX(Schedules; Schedules[AverageHours]))
 
I'll add two screenshots of what happens, but what I'd like to see is something like this:
Month Current Employees Average Hours Measure
November21224
November 12424
November1840720
Total 21 768
 
 
 
 
 
 
 
 
 
 
 
 
 
 

13 Replies