Forum Discussion
PowerMyBI
Helper I
6 years agoCalculate sum by date and type
Hi Power BI community, I am trying to calculate the sum of units recorded each day by staff member. Effectively I have many columns of transaction data pulled from our practice management platfor...
- 6 years ago
Great PowerMyBI - Glad you got it figured out. I misunderstood your original request. For grins I went back and revised my measure and this returns the same. Be sure to mark one as the solution so this thread can be marked as solved.
Total 2 = VAR varCurrentName = MAX( 'Table'[StaffName] ) VAR varCurrentDate = MAX( 'Table'[Date] ) VAR Result = CALCULATE( SUM( 'Table'[Units] ), FILTER( ALL( 'Table'[Date], 'Table'[StaffName], 'Table'[Units] ), 'Table'[Date] = varCurrentDate && 'Table'[StaffName] = varCurrentName ) ) RETURN Result
PowerMyBI
Helper I
6 years agoThink I managed to figure it out:
SumPerStaffAndDay = CALCULATE(SUM(Table1[Units]), ALLEXCEPT(Table1, Table1[Date].[Date], Table1[StaffName]))