Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
BrianNeedsHelp
Resolver I
Resolver I

DAX 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

 

LocationQuotaDateHours ClosedEmpQuotaImpact
Location A 449/1/20248Bob1.41
Location A 449/1/29248Bob1.41
Location B 129/1/20248Suzy0.38
Location C 139/1/20248Suzy0.41
Location C 1610/1/20244Suzy0.25
1 ACCEPTED SOLUTION
aeagleton-coop
New Member

Quota Impact =

VAR Granularity =
SUMMARIZE(
    InputTable,
    InputTable[Emp],
    InputTable[Location],
    InputTable[Date],
    InputTable[Quota]
)

RETURN
SUMX(
    Granularity,
    VAR HoursClosed = CALCULATE(SUM(InputTable[Hours Closed]))
    VAR DaysInMonth = 31  /* DAY(EOMONTH([Date], 0)) */
    RETURN [Quota] / (DaysInMonth * 8) * HoursClosed    
)

View solution in original post

2 REPLIES 2
BrianNeedsHelp
Resolver I
Resolver I

Works Beautiful!   

aeagleton-coop
New Member

Quota Impact =

VAR Granularity =
SUMMARIZE(
    InputTable,
    InputTable[Emp],
    InputTable[Location],
    InputTable[Date],
    InputTable[Quota]
)

RETURN
SUMX(
    Granularity,
    VAR HoursClosed = CALCULATE(SUM(InputTable[Hours Closed]))
    VAR DaysInMonth = 31  /* DAY(EOMONTH([Date], 0)) */
    RETURN [Quota] / (DaysInMonth * 8) * HoursClosed    
)

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.