Forum Discussion

Miawto's avatar
Miawto
New Member
2 years ago
Solved

Calucation between imported table and summarized & cross joined table

Hi,  I need to calculate available hours pr. employee per team per month e.g. like this:  Table A: Imported table with project allocations pr. day pr. employee e.g., Date Project Initia...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Miawto ,

     

    Thanks AmiraBedh  for the quick reply. I have some other thoughts to add and am not sure if I have understood your needs correctly, if I have misunderstood please give the expected results and processing logic in a follow up reply.

     

    (1)We can create two columns.

    Month Column = FORMAT([Date],"mmmm")
    Available hours = 
    var _SumCapacity=CALCULATE(SUM('Table B'[SumCapacity]),FILTER('Table B',[Month]=EARLIER('Table A'[Month Column]) && 'Table B'[Initials]=EARLIER('Table A'[Initials])))
    var _hour=CALCULATE(SUM('Table A'[Hours]),FILTER('Table A',[Date]<=EARLIER('Table A'[Date]) && [Initials]=EARLIER('Table A'[Initials])))
    RETURN _SumCapacity-_hour

    (2)Then the result is as follows.

    Best Regards,

    Neeko Tang

    If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly.