无法获得Power BI的前1名?

时间:2018-10-03 07:56:07

标签: powerbi powerbi-desktop powerbi-mobile

  • 客户表

    包含“状态”,“创建日期”,“更新日期”列

  • ascs表

    包含“ service_station_name”列

首先,我使用以下的eqn为“状态计数”添加新的度量标准:

    Status Count = COUNT('cps customers'[status])

然后通过使用以下等式nn,为“天数持续时间”创建新列:

     Day Duration2 = SWITCH('cps 
     customers'[status],"Closed",DATEDIFF('cps customers'[created_at], 
    [updated_at],DAY),"Unattended",DATEDIFF('cps 
    customers'[created_at],NOW(),DAY),"Assigned",DATEDIFF('cps 
    customers'[created_at],NOW(),DAY),"NotApplicable",DATEDIFF('cps 
    customers'[created_at],NOW(),DAY),"Open",DATEDIFF('cps 
    customers'[created_at],NOW(),DAY))

我需要顶级服务站名称。 条件:

    i.   Consider only **closed status**
    ii.  Top count of **closed status count**
    iii. Lowest **time duration**

步骤:

  1. 选择列 service_station_name 状态状态计数持续时间2 enter image description here

  2. 从“状态”列中过滤关闭状态。 enter image description here

  3. 为“状态计数”添加TOPN过滤 enter image description here

    现在,我得到了三个service_station_name,其中每个都有5个关闭状态计数。

  4. 为了获得最低的“ day duration2”,我使用了升序 enter image description here

  5. 为了显示前1个service_station_name,我从中选择了 CARD 可视化并获得第一个service_station_name 。但我还没有 正确答案 enter image description here

  6. 然后我使用了最后一个service_station_name 。在这里我也没有 答案。enter image description here

基于屏幕截图,我需要“ Om Sakthi Engineering”作为答案。 我如何得到答案?谁能帮我!

1 个答案:

答案 0 :(得分:0)

您实际上可以在另一列“ NewColumn”中添加,则该值将是“状态计数”除以“天持续时间”。最高的值将是最高的。

NewColumn = divide(Table1[Status Count],Table1[Day Duration])

然后,您可以使用卡片可视化选择最高的一个值。 在过滤器下,应将状态过滤为关闭,过滤此NewColumn的前1个。 enter image description here