Forum Discussion

jaime_blackwell's avatar
6 years ago
Solved

GROUPBY Returning an Error, Please Help.

Hi Community,   I'm having difficulty creating a measure using DAX. I want to group records by DATE and get TOTAL DECIMAL TIME of each group.   So far I'm using the GROUPBY function, but I'm rece...
  • Anonymous's avatar
    Anonymous
    6 years ago
    [Total Time] = SUM( T[Decimal Time] )
    
    [Billable Time] =
    var __breakTime = 1 * time(0, 30, 0)
    var __result =
    	SUMX(
    		SUMMARIZE(
    			T,
    			T[UserID],
    			T[Date]
    		),
    		var __time = [Total Time]
    		var __deduction = ( __time > 5 ) * __breakTime
    		return
    			__time - __deduction
    	)
    return
    	__result
    	
    [Billable Time %] =
    	DIVIDE(
    		[Billable Time],
    		[Total Time]
    	)

     

    Best

    D