如何在DAX查询的过滤器中使用测量结果?

发布于 2025-02-01 09:22:52 字数 557 浏览 3 评论 0原文

我在Power BI数据集中有一个措施,称为Nett Wipp。 我需要编写一个查询,该查询从我的数据集和过滤器中获取一些数据,其中nett wip不是0。

在普通英语中,我的查询应该是: get m get me发票recov%nett wip不是0 (发票recov%是表中的一列)

使用dax Studio查询构建器,生成以下查询:

EVALUATE
CALCULATETABLE(
    ROW(
    "Invoice Recov %", [Invoice Recov %]
    ),
    KEEPFILTERS( FILTER( ALL( [Nett WIP] ), [Nett WIP] <> 0 ))
)

但是,由于过滤器中使用的度量,此查询不起作用。我知道该度量是一种计算,这就是为什么它不起作用,但是我该如何编写此查询呢?在MSSQL中,我会考虑使用“ have”子句,是否有类似于dax中的子句类似的东西?

请原谅我的天真,因为我是DAX的新手。 任何帮助将不胜感激。

I have a measure in my power bi dataset called Nett Wipp.
I need to write a query that gets some data from my dataset and filters where Nett Wip is not 0.

In plain English my query should be: get me Invoice Recov % where Nett Wip is not 0
(Invoice Recov % is a column in a table)

Using Dax Studio Query Builder, the below query is generated:

EVALUATE
CALCULATETABLE(
    ROW(
    "Invoice Recov %", [Invoice Recov %]
    ),
    KEEPFILTERS( FILTER( ALL( [Nett WIP] ), [Nett WIP] <> 0 ))
)

However, this query does not work as a result of the measure being used in the filter. I understand that the measure is a calculation, and that is why it is not working, but how can I write this query then? In MsSql I would consider using a having clause, is there something similar to a having clause in DAX?

Please forgive my naivety as I am very new to Dax.
Any help would be greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

木緿 2025-02-08 09:22:52

您可以尝试:

FILTER(
    [Invoice Recov %], 
    [Nett WIP] <> 0 
)

You can try :

FILTER(
    [Invoice Recov %], 
    [Nett WIP] <> 0 
)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文