【问题标题】:Date diff using dates in the same column DAX使用同一列 DAX 中的日期进行日期差异
【发布时间】:2020-10-21 03:03:05
【问题描述】:

我有一个数据集,我正在尝试使用每个操作的注释日期来计算用户对经销商注释的响应时间。

这是我的示例数据,我在 hive 查询中使用滞后、领先和最小窗口函数计算了这个,但我的用户希望在 Power BI 中看到这个。

这是我迄今为止尝试过的。

我创建了一个“用户注释日期”度量来获取用户响应的第一个响应

user note date = CALCULATE(MIN(Query1[Note Date]),ALLEXCEPT(Query1,Query1[incident],Query1[Action Type]),
LEFT(Query1[lastuser],1) in {"U"} )
 
Dealer Note Date  = 
CALCULATE(
MIN(Query1[pdate]),
FILTER(ALLEXCEPT(Query1,Query1[incident],Query1[action_type]),
Query1[action_type] in {
"DLR_CUST_Update"
))

我从 Dealer Note Date Measure 收到此错误,我不明白上述计算有什么问题。

错误:无法确定表“Query1”中“操作类型”列的单个值。当度量公式引用包含许多值但未指定聚合(例如 min)的列时,可能会发生这种情况

这是我的示例数据

【问题讨论】:

    标签: powerbi dax powerbi-desktop daxstudio


    【解决方案1】:

    [Dealer Note Date] 计算中的列是 query1[action_type] 还是 Query1[Action Type]??

    您无法访问 [Dealer Note Date] 中的 Query1[action_type] 列,因为您在 ALLEXCEPT 中将其排除在外

    Dealer Note Date  = 
    CALCULATE(
    MIN(Query1[pdate]),
    FILTER(ALLEXCEPT(Query1,Query1[incident],**Query1[action_type]**),
    Query1[action_type] in {
    "DLR_CUST_Update"
    ))
    

    【讨论】:

    • 知道了,谢谢@msta42a
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-04-30
    • 1970-01-01
    • 2019-09-25
    • 2013-01-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多