簡體   English   中英

DAX - Power BI Import 中包含度量的多個表和列

[英]DAX - Multiple tables & columns with measures in Power BI Import

我正在編寫要在執行 Power BI SQL 服務器分析服務數據庫導入時使用的 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") 
) 
)

我已經嘗試了我能找到的一切,但似乎沒有任何效果。 如果我遺漏了一個措施,它會按預期工作。

試試這樣:

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] )
)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM