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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
I get an error when trying to load a table visual which relies on a Work Days within Timeframe calculation. I have validated the measure results and it works as expected at the employee level, accounting for start date, end date, hire and termination date, for all employees in the dataset, even if the termination date is hypothetical (in the future). But breaks when using it to calculate hours ([Work Days within Timeframe]*8)
Solved! Go to Solution.
Hi @evgeniam,
From the error message, the issue should be related to the first parameter value in CALENDAR() function is larger than the second parameter value. As you use three IF() functions in result section and each IF() uses CALENDAR() function, I would suggest you return one IF() condition result each time to decide which IF() function has the issue.
In my opinion, the issue is possibly related to last two IF() parts, as we can't ensure the MAX ( start_Date, hire_Date ) is less or equal to the termination_Date in second IF() part. It's the same as MAX ( start_Date, hire_Date ) in last IF() part.
Best Regards,
Qiuyun Yu
Hi @evgeniam,
From the error message, the issue should be related to the first parameter value in CALENDAR() function is larger than the second parameter value. As you use three IF() functions in result section and each IF() uses CALENDAR() function, I would suggest you return one IF() condition result each time to decide which IF() function has the issue.
In my opinion, the issue is possibly related to last two IF() parts, as we can't ensure the MAX ( start_Date, hire_Date ) is less or equal to the termination_Date in second IF() part. It's the same as MAX ( start_Date, hire_Date ) in last IF() part.
Best Regards,
Qiuyun Yu
Got it! It was in the second IF (). Fixed by changing
IF(AND(termination_Date<end_Date, termination_Date>start_Date)
to
IF(termination_Date<end_Date && termination_Date>start_Date &&termination_Date>hire_Date)
Thank you for looking into this! I will investigate further.
I was wondering if this could be a bug considering when I create a table visual with Employee, Hire Date, Termination Date and Work Days within Timeframe columns, it works and I get the correct number of days listed for each employee (depended on the date slicer selection). Why does the measure work in that context, but not when used in a calculation within another measure?
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.