DAX - 多个表和多个表Power BI 导入中包含度量的列

发布于 2025-01-19 00:17:20 字数 884 浏览 4 评论 0原文

我正在编写执行Power BI SQL Server分析服务数据库导入的DAX查询。我想限制要使用的字段和记录。我不知道如何在查询中包括措施。任何帮助将不胜感激!

这起作用:

EVALUATE (
SUMMARIZECOLUMNS (
'Date PT'[Calendar Date PT],
'Date PT'[Fiscal Month PT],
'Date PT'[Fiscal Year PT],
'Issue Code'[Code 2],
'Planning Cat'[Planning Area],
FILTER('Date PT', 'Date PT'[Fiscal Year PT]= "FY22"),
FILTER('Planning Cat', [Planning Area]= "NOA")
)
)

我需要按预订日期添加销售(一种措施),我会发现一个错误,说“在此表达式中找不到或找不使用”

这不是工作

EVALUATE ( 
SUMMARIZECOLUMNS (
'Date PT'[Calendar Date PT],
'Date PT'[Fiscal Month PT],
'Date PT'[Fiscal Year PT],
'Issue Code'[Code 2], 
'Planning Cat'[Planning Area],
'Sales'[Sales by Booked Date],
FILTER('Date PT', 'Date PT'[Fiscal Year PT]= "FY22"), 
FILTER('Planning Cat', [Planning Area]= "NOA") 
) 
)

我已经尝试了所有我能找到的一切,但似乎没有任何作用。如果我省略了措施,则可以按预期工作。

I am writing a DAX query to be used while performing a Power BI SQL Server Analysis Services database Import. I want to limit the fields and records to be used. I cannot figure out how to include measures in my query. Any help would be appreciated!

This works:

EVALUATE (
SUMMARIZECOLUMNS (
'Date PT'[Calendar Date PT],
'Date PT'[Fiscal Month PT],
'Date PT'[Fiscal Year PT],
'Issue Code'[Code 2],
'Planning Cat'[Planning Area],
FILTER('Date PT', 'Date PT'[Fiscal Year PT]= "FY22"),
FILTER('Planning Cat', [Planning Area]= "NOA")
)
)

I need to add in Sales by Booked Date (a measure) and I get an error stating that this field "cannot be found or cannot be used in this expression"

THIS DOES NOT WORK

EVALUATE ( 
SUMMARIZECOLUMNS (
'Date PT'[Calendar Date PT],
'Date PT'[Fiscal Month PT],
'Date PT'[Fiscal Year PT],
'Issue Code'[Code 2], 
'Planning Cat'[Planning Area],
'Sales'[Sales by Booked Date],
FILTER('Date PT', 'Date PT'[Fiscal Year PT]= "FY22"), 
FILTER('Planning Cat', [Planning Area]= "NOA") 
) 
)

I have tried everything I can find but nothing seems to work. If I leave a measure out, it works as expected.

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

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

发布评论

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

评论(1

腹黑女流氓 2025-01-26 00:17:20

试试这个方法:

EVALUATE  
ADDCOLUMNS(
   SUMMARIZECOLUMNS (
      'Date PT'[Calendar Date PT], 
      'Date PT'[Fiscal Month PT], 
      'Date PT'[Fiscal Year PT], 
      'Issue Code'[Code 2], 
      'Planning Cat'[Planning Area], 
      FILTER(
         'Date PT', 
         'Date PT'[Fiscal Year PT]= "FY22"
      ), 
      FILTER(
         'Planning Cat', 
         [Planning Area]= "NOA"
      ) 
   ),
   "@SalesByBookedDate", CALCULATE ( 'Sales'[Sales by Booked Date] )
)

Try this way:

EVALUATE  
ADDCOLUMNS(
   SUMMARIZECOLUMNS (
      'Date PT'[Calendar Date PT], 
      'Date PT'[Fiscal Month PT], 
      'Date PT'[Fiscal Year PT], 
      'Issue Code'[Code 2], 
      'Planning Cat'[Planning Area], 
      FILTER(
         'Date PT', 
         'Date PT'[Fiscal Year PT]= "FY22"
      ), 
      FILTER(
         'Planning Cat', 
         [Planning Area]= "NOA"
      ) 
   ),
   "@SalesByBookedDate", CALCULATE ( 'Sales'[Sales by Booked Date] )
)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文