Forum Discussion
Calculate SUM where Date = MAX
- 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.
You miss something, after the max.
you should reference the fgact table (code), like:
&& 'FactTable'[ID] = MAX('DimTable'[ID])I hope I'm seeing things clearly here.
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.
- RemiAnthonise8 years ago
Helper V
Thankks rajulshah ! I'm happy with the result.