Forum Discussion
Column sum issue
- 5 years ago
Hi Anonymous ,
You'd better create measure instead of calculated column to calculate the Hours worked. Try the following formula.
Measure = MAX(HASI_Wrkhrs[Hrs per month]) - CALCULATE( SUM(HASI_Wrkhrs[Leaves in hrs]), FILTER( ALLSELECTED(HASI_Wrkhrs), HASI_Wrkhrs[emp_code] = MAX(HASI_Wrkhrs[emp_code]) && MONTH(HASI_Wrkhrs[date_start]) = MONTH( MAX(HASI_Wrkhrs[date_start]) ) && HASI_Wrkhrs[date_start] <= MAX(HASI_Wrkhrs[date_start]) ) )This is my PBIX file.
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.Best Regards,
WinnizIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
You'd better create measure instead of calculated column to calculate the Hours worked. Try the following formula.
Measure =
MAX(HASI_Wrkhrs[Hrs per month]) - CALCULATE(
SUM(HASI_Wrkhrs[Leaves in hrs]),
FILTER(
ALLSELECTED(HASI_Wrkhrs),
HASI_Wrkhrs[emp_code] = MAX(HASI_Wrkhrs[emp_code])
&& MONTH(HASI_Wrkhrs[date_start]) = MONTH( MAX(HASI_Wrkhrs[date_start]) )
&& HASI_Wrkhrs[date_start] <= MAX(HASI_Wrkhrs[date_start])
)
)This is my PBIX file.
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.