March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
134 | |
90 | |
90 | |
66 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
70 | |
68 |