Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi Community,
I need a small & quick help, its probably something too simple 😊
My matrix on the report looks like following: I have a calender table that is linked to my data table
Leaves in hrs is calculated from two columns 'Start_date' & end_date' which are the dates of leaves taken. I converted the number of leaves take(in days) to Hours.
Hrs_worked = hrs_per_month - Leaves in Hrs
Hrs_worked is a column. The issue is I can't get the Hrs_worked right where there is more than one 'Leaves in hrs' (hrs worked in blue are expected hours_worked).
Please suggest how can I get the right Hours_worked.
My pbi: https://1drv.ms/u/s!Ag919_pO_UKrgRJuluqNoYvl-Zba?e=NynFhy
TIA
Solved! Go to Solution.
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.
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.
Can you please share some data also can you please share how are you calculating Leave Hrs & Hrs Worked with your data?
Proud to be a Super User!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!