Forum Discussion
aktripathi2506
9 years agoHelper IV
Calculated column by using group by other columns.
Hi All, I want to calculate total hour spent by the employee for a day Please find below the example I have also included the desired column which I am trying to get. Name Date Task...
v-ljerr-msft
9 years agoMicrosoft Employee
In this scenario, you can use a Filter with VAR function to SUM Hours Spent for a day for a specific Name. See my sample below.
I assume you have a table called MyTestTable like below.
Then you should be able to use the formula below to create a calculate column to get Hours Spent for a day for a specific Name.
Hour Spent For A Day =
VAR name1 = MyTestTable[Name]
VAR date1 = MyTestTable[Date]
RETURN
CALCULATE (
SUM ( MyTestTable[Hours spent] ),
ALL ( MyTestTable ),
FILTER ( MyTestTable, MyTestTable[Name] = name1 && MyTestTable[Date] = date1 )
)
Regards