表达式:评估期间遇到了环状参考。 - 使用Power查询中的自定义功能网络日
我已经从空白查询中创建了一个自定义功能,以计算出不包括假期和周末的天数,该功能
Query1 = (StartDate as date, EndDate as date) as number =>
let
DateList = List.Dates(StartDate, Number.From(EndDate - StartDate) , #duration(1, 0, 0, 0)),
RemoveWeekends = List.Select(DateList, each Date.DayOfWeek(_, Day.Monday) < 5),
RemoveHolidays = List.RemoveItems(RemoveWeekends, Holidays),
CountDays = List.Count(RemoveHolidays)
in
CountDays,
Custom1 = Query1
in
Custom1
在我的计算机上的文件中都在工作,但是问题是当我团队中的其他任何人都在尝试使用那里有查询的文件。我们正在遇到错误&lt; expression.Error:评估期间遇到了环状参考。&gt;
我试图追踪步骤,并找出何时发生错误,并且总是指向自定义功能。 请帮助我,我需要尽快修复它,以便我的团队可以使用它。
日历
”使用此YouTube指南创建函数: https://www.youtube.com/watch = v = v = v = E2IC432NVHY
I have created a custom function from a blank query to calculate the number of days excluding holidays and the weekends, the function is below
Query1 = (StartDate as date, EndDate as date) as number =>
let
DateList = List.Dates(StartDate, Number.From(EndDate - StartDate) , #duration(1, 0, 0, 0)),
RemoveWeekends = List.Select(DateList, each Date.DayOfWeek(_, Day.Monday) < 5),
RemoveHolidays = List.RemoveItems(RemoveWeekends, Holidays),
CountDays = List.Count(RemoveHolidays)
in
CountDays,
Custom1 = Query1
in
Custom1
Everything is working in the file on my computer, but the issue is when anyone else from my team is trying to use the file with queries there. We are getting error <Expression.Error: A cyclic reference was encountered during evaluation.>
I've tried to trace steps and find out when the error is occurring and it's always pointing at the custom function.
Please help me, I need to fix it asap so my team can use this.
I was using this youtube guide to create function: https://www.youtube.com/watch?v=e2ic432NvhY
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试将功能更改为
那时,假设假期是一个查询,并有一些日期列表,
然后
工作正常
try changing your function to
then, assuming Holidays is a query with some list of dates like
then
works fine
感谢大家的快速答案。
我的问题是,首先,我基于节日和日历列表创建了自定义功能,然后也在日历中使用了它。当我从日历查询中删除自定义功能,仅留下一周的开始日期,结束日期和周数,它再次开始工作。
Thanks everyone for such quick answers.
My issue was that first I've created custom function based on list of holidays and calendar and then i've used it in calendar as well. When I removed custom function from the calendar query, leaving only starting date of the week, ending date and week number it started to work again.