Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 |
Hi @Anonymous ,
Correct your measure as below:
Measure = CALCULATE(MAX('Schedules'[Current Employees]) * SUMX('Schedules','Schedules'[AverageHours]))
And you will see:
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
@v-kelly-msft @Greg_Deckler @amitchandak
Sorry it seems like I linked to the wrong data.
The previous link should now work.
Hi @Anonymous ,
Sorry for the late reply,but the sample data has been removed,can you update it?
Hi @Anonymous ,
Can you advise me what is in [AverageHours]?Is it a measure?I cant reappear the table you showed in the oringinal post,can you share me your .pbix file if it's not confidential?
Hi @v-kelly-msft ,
I cant share the original pbix since it has employee information in it.
Average hours is the hours an employee should work in a week (like 40 hours or 32).
I updated the csv to show the average hours since hours does nothing more than show 40.
Best Regards,
Queenie
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])
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
Hi @Greg_Deckler ,
I made an excel file with the data you should need.
Let me know if you need anything else.
Hi @Anonymous ,
It' s an excel about calendar table,no extra data,can you update it?
I'm with @amitchandak , that's just a calendar.
It seems like a calendar
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
80 | |
66 | |
58 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |