【发布时间】:2022-12-22 14:39:47
【问题描述】:
此 M(Power Query)函数给出此错误“Expression.Error:我们无法将类型 Function 的值转换为类型 Text。” 功能目标是有两个文本输入并将它们减去持续时间(如列表或 tex)
例如: 1/20/2020 下午 1:49:46、1/20/2020 下午 1:58:03、1/20/2020 下午 2:09:42
1/20/2020 下午 1:49:41、1/20/2020 下午 1:57:58、1/20/2020 下午 2:09:38
let
Source = (txtCheckInTime as text, txtCheckOutTime as text) as text=> let
lstCheckinTimeLst = Text.Split(txtCheckInTime, ", "),
lstCheckOutTimeLst = Text.Split(txtCheckOutTime, ", "),
txtCheckInEvent = each lstCheckinTimeLst,
txtCheckOutEvent = each lstCheckOutTimeLst,
EventDuration = DateTime.FromText(txtCheckInEvent) - DateTime.FromText(txtCheckOutEvent) ,
Source = Text.Combine(Duration.ToText(EventDuration),", ")
in
Source
in
Source
无论如何可以指出错误吗?
【问题讨论】:
-
以下两行是罪魁祸首:txtCheckInEvent = each lstCheckinTimeLst, txtCheckOutEvent = each lstCheckOutTimeLst,
标签: formula powerquery m