Forum Discussion

RemiAnthonise's avatar
8 years ago
Solved

Calculate SUM where Date = MAX

Hi guys,   I couldn't find the right answer, maybe you can help me.   I've got a table, see image below. It's possible that salary, bonus etc gets updated so I want to calculate with the most rec...
  • rajulshah's avatar
    rajulshah
    8 years ago

    Hello RemiAnthonise,

     

    This can be restructured as:

     

    Salaris = [Factor opslag] * CALCULATE(SUM(WorkerPositionEarningCodes[Amount]); WorkerPositionEarningCodes[EarningCodeId] = "Salaris"; FILTER(WorkerPositionEarningCodes,WorkerPositionEarningCodes[ValidFrom]=MAX(WorkerPositionEarningCodes[ValidFrom])))

     

    Hope this works.

     

    Regards.