Forum Discussion
Calculate Hours
Hey guys,
I'm working on a new rapport and my issue is with calculating the hours spend on a project
I have 2 tables and in one of them is the complete registration of Hours and I have another table in which i want the calculated column that sums the values from table 1 based on 1)weeknumber and 2)projectcode
Table 1 and 2 have a relationship
I need a formula that SUMS the value
IF(AND(table1[week] = table2[week] , table1[projectcode] = table2[projectcode]) ,SUM(Table2[Hours]))
Hi RonaldvdH ,
It seems that Table1 and Table2 are connected through ProjectCode column. If yes, You just need to create the calculated column below:
Column = CALCULATE ( SUM ( Table2[Hours] ), FILTER ( RELATEDTABLE ( Table2 ), Table2[Week] = Table1[Week] ) )If this answer solves your problem, give it a thumbs up and mark it as an accepted solution so the others would find what they need easier.
Regards,
Loran
1 Reply
- MohammadLoran25Solution Sage
Hi RonaldvdH ,
It seems that Table1 and Table2 are connected through ProjectCode column. If yes, You just need to create the calculated column below:
Column = CALCULATE ( SUM ( Table2[Hours] ), FILTER ( RELATEDTABLE ( Table2 ), Table2[Week] = Table1[Week] ) )If this answer solves your problem, give it a thumbs up and mark it as an accepted solution so the others would find what they need easier.
Regards,
Loran