如何使相当于 SQL 中的分区的 dax 列对页面过滤器做出反应?

问题描述 投票:0回答:1

我有一个这样的专栏

|group|    email    |finished|
|A    |[email protected]|  1     |
|B    |[email protected]|  1     |
|C    |[email protected]|  0     |
|C    |[email protected]|  1     |
|A    |[email protected]|  1     |

我想要这样的东西

select 
        *,
        min(finished)
          OVER(group by email) as Completed 
        from T

应该返回

|group|    email    |finished|completed|
|A    |[email protected]|  1     |    0    |
|B    |[email protected]|  1     |    0    |
|C    |[email protected]|  0     |    0    |
|C    |[email protected]|  1     |    1    |
|A    |[email protected]|  1     |    1    |

我尝试过使用 DAX 进行计算、过滤、汇总等...

问题是它对页面过滤器没有反应,有什么解决方法吗?

当前 dax 列

completed= if(ISEMPTY(FILTER(ALLSELECTED(t),
                       t[Email] = EARLIER( t[Email] ) 
                       && t[finished] = 0)), 
                       1, 0)

谢谢

powerbi dax powerbi-desktop measure daxstudio
1个回答
0
投票

尝试将此作为一种措施:

CALCULATE (
    MIN ( t[finished] ),
    ALLEXCEPT (
        t,
        t[Email]
    )
)
© www.soinside.com 2019 - 2024. All rights reserved.