Forum Discussion
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.
| Month | Current Employees | Average Hours | Measure |
| November | 2 | 12 | 24 |
| November | 1 | 24 | 24 |
| November | 18 | 40 | 720 |
| Total | 21 | 768 |
13 Replies
- Greg_Deckler
Community Champion
Can you post the source data as text? Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
- AnonymousNot applicable
Hi Greg_Deckler ,
I made an excel file with the data you should need.
Let me know if you need anything else.
- amitchandak
Super User
It seems like a calendar
- amitchandak
Super User
This multiplication need to be done at some context level like Month or employee ID, Based on that use formula like this
Measure = CALCULATE([Current Employees] * SUMX(Schedules; Schedules[AverageHours]), values(date[Month])) Measure = Sumx(SUMMARIZE(Table, date[Month],"_sum"[Current Employees] * SUMX(Schedules; Schedules[AverageHours])),[_sum]) - AnonymousNot applicable
v-kelly-msft Greg_Deckler amitchandak
Sorry it seems like I linked to the wrong data.
The previous link should now work.
- v-kelly-msft
Community Support
Hi Anonymous ,
Sorry for the late reply,but the sample data has been removed,can you update it?
Best Regards,
KellyDid I answer your question? Mark my post as a solution!- AnonymousNot applicable
- v-kelly-msft
Community Support
Hi Anonymous ,
Correct your measure as below:
Measure = CALCULATE(MAX('Schedules'[Current Employees]) * SUMX('Schedules','Schedules'[AverageHours]))And you will see:
Best Regards,
KellyDid I answer your question? Mark my post as a solution!- AnonymousNot applicable
Thank you so much for helping me v-kelly-msft!
But I can't seem to use the measure [Current Employees] in a MAX function.
Any other ideas?
Best regards,
Queenie Barends