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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.