Forum Discussion
BrianNeedsHelp
Resolver I
1 year agoDAX Summarize By Employee With Formula
I have a table like this that computes the Quota Impact by this formula. ([Quota]/([Days in Month]*8))*[Hours Closed]. It works fine when all the rows of the table are selected in the Visual. However I'm trying to group this by Employee, but it sums the Quota Amount for each location and then computes, which is expected, but I'm not certain how to calculate it something like [Quota] divided by Count by Location given there could be an entry in two different months . Summary it should look like this Bob =44/248 * 16:
Emp Quota Impact
Bob 2.82
Suzy 1.04
Instead I get : Bob=88/248 * 16:
Emp Quota Impact
Bob 5.67
Suzy 2.08
| Location | Quota | Date | Hours Closed | Emp | QuotaImpact |
| Location A | 44 | 9/1/2024 | 8 | Bob | 1.41 |
| Location A | 44 | 9/1/2924 | 8 | Bob | 1.41 |
| Location B | 12 | 9/1/2024 | 8 | Suzy | 0.38 |
| Location C | 13 | 9/1/2024 | 8 | Suzy | 0.41 |
| Location C | 16 | 10/1/2024 | 4 | Suzy | 0.25 |
- Quota Impact =VAR Granularity =SUMMARIZE(InputTable,InputTable[Emp],InputTable[Location],InputTable[Date],InputTable[Quota])RETURNSUMX(Granularity,VAR HoursClosed = CALCULATE(SUM(InputTable[Hours Closed]))VAR DaysInMonth = 31 /* DAY(EOMONTH([Date], 0)) */RETURN [Quota] / (DaysInMonth * 8) * HoursClosed)
2 Replies
- aeagleton-coopNew MemberQuota Impact =VAR Granularity =SUMMARIZE(InputTable,InputTable[Emp],InputTable[Location],InputTable[Date],InputTable[Quota])RETURNSUMX(Granularity,VAR HoursClosed = CALCULATE(SUM(InputTable[Hours Closed]))VAR DaysInMonth = 31 /* DAY(EOMONTH([Date], 0)) */RETURN [Quota] / (DaysInMonth * 8) * HoursClosed)
- BrianNeedsHelp
Resolver I
Works Beautiful!