功率查询-动态参数不起作用

时间:2019-04-17 18:32:21

标签: dynamic powerquery m

我在PQ中有以下查询。

let
    paramYr = paramYr,
    paramMonth = paramMonth,
    concatPeriod = concatPeriod,
    Source =AnalysisServices.Database("CUBESERVER", "SSAS200R", [TypedMeasureColumns=true]),
    #"LN LEDGER CUBE1" = Source{[Id="LN LEDGER CUBE"]}[Data],
    #"LN LEDGER CUBE2" = #"LN LEDGER CUBE1"{[Id="LN LEDGER CUBE"]}[Data],
    #"Added Items" = Cube.Transform(#"LN LEDGER CUBE2",
        {
            {Cube.AddAndExpandDimensionColumn, "[CHART OF ACCOUNTS]", {"[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].[LEDGER ACCOUNT AND DESCRIPTION]"}, {"CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION"}},
            {Cube.AddMeasureColumn, "USD BALANCE", "[Measures].[USD BALANCE]"}
        }),
    #"Filtered Rows" = Table.SelectRows(#"Added Items", each (Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[77]" meta [DisplayName = "16001 - INVENTORY - ERROR SUSPENSE"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[78]" meta [DisplayName = "16005 - INVENTORY - OBSOLETE"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[79]" meta [DisplayName = "16006 - INVENTORY - OBS BURDEN RESERVE"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[80]" meta [DisplayName = "16007 - INVENTORY - EST FLOOR STOCK"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[82]" meta [DisplayName = "16016 - INVENTORY - SALES TO SUPPLIERS"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[83]" meta [DisplayName = "16020 - INVENTORY - CUST OWNED EQUIP"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[84]" meta [DisplayName = "16050 - INV - LABOUR RATE VARIANCE"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[85]" meta [DisplayName = "16052 - INV - LABOUR EFFICIENCY VAR"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[86]" meta [DisplayName = "16060 - INV - PURCHASE PRICE VAR"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[87]" meta [DisplayName = "16062 - INV - SUBCONTRACT PRICE VAR"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[88]" meta [DisplayName = "16064 - INV - MATERIAL USAGE VAR"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[89]" meta [DisplayName = "16066 - INV - OTHER VARIANCE"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[91]" meta [DisplayName = "16100 - INTERIM TRANSIT1 INVEN XACTION"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[92]" meta [DisplayName = "16101 - INTERIM TRANSIT10 SRVC TO PROJ"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[93]" meta [DisplayName = "16102 - INTERIM TRANSIT11 LABR XACTION"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[94]" meta [DisplayName = "16103 - INTERIM COST1 SLS ORD INV-COS"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[95]" meta [DisplayName = "16104 - INTERIM COST3 MSO COST TO COS"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[96]" meta [DisplayName = "16105 - INTERIM COST4 SRVC ORD INV-COS"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[97]" meta [DisplayName = "16106 - INTERIM COST21 INV TO PROJ WIP"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[98]" meta [DisplayName = "16107 - INTERIM VARIANCE1 PURCH, PRODN"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[101]" meta [DisplayName = "16110 - XFR MWO 2 MSO INTERIM TRANSIT9"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[102]" meta [DisplayName = "16111 - XM INTEGRATN INTERIM TRANSIT12"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[103]" meta [DisplayName = "16112 - PROJ WIP INTERIM-DIRECT AP"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[104]" meta [DisplayName = "16113 - SRV ORD WIP INTERIM-DIRECT AP"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[105]" meta [DisplayName = "16114 - MWO WIP INTERIM-DIRECT AP"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[106]" meta [DisplayName = "16115 - INTERIM CNTRCT1 MSO TO CNTRCT"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[107]" meta [DisplayName = "16813 - INVENTORY - COST ADJSTMNTS RM"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[108]" meta [DisplayName = "16814 - INVENTORY - COST ADJSTMNTS WIP"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[109]" meta [DisplayName = "16824 - INVENTORY - APS BIN SYSTEM"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[110]" meta [DisplayName = "16960 - INVENTORY - MATERIAL"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[111]" meta [DisplayName = "16961 - INVENTORY - LABOUR"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[112]" meta [DisplayName = "16962 - INVENTORY - BURDEN"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[113]" meta [DisplayName = "16963 - INVENTORY - ODC"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[114]" meta [DisplayName = "16964 - INVENTORY REVALUATION ADJS"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[115]" meta [DisplayName = "16970 - INVENTORY - WIP - MATERIAL"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[116]" meta [DisplayName = "16971 - INVENTORY - WIP - LABOUR"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[117]" meta [DisplayName = "16972 - INVENTORY - WIP - BURDEN"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[118]" meta [DisplayName = "16973 - INVENTORY - WIP - ODC"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[119]" meta [DisplayName = "16974 - INVENTORY - WIP - ADJUSTMENTS"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[120]" meta [DisplayName = "16980 - INVENTORY - RM RECLASS"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[121]" meta [DisplayName = "16981 - INVENTORY - NON-CNTRCT WIP RCL"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[122]" meta [DisplayName = "16982 - INVENTORY - FG RECLASS"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[123]" meta [DisplayName = "16983 - INVENTORY - CNTRCT WIP RECLASS"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[124]" meta [DisplayName = "17000 - PROJECT WIP -NON-INVNTRY CHRGS"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[125]" meta [DisplayName = "17001 - PROJECT WIP ACCRUALS"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[126]" meta [DisplayName = "17002 - PROJECT WIP START UP"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[128]" meta [DisplayName = "17010 - PROJECT WIP SUSPENSE"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[129]" meta [DisplayName = "17100 - PROJECT WIP - MATERIAL"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[130]" meta [DisplayName = "17101 - PROJECT WIP - LABOUR"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[132]" meta [DisplayName = "17103 - PROJECT WIP - ODC"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[721]" meta [DisplayName = "17199 - PROJECT CLOSURE CLEARING"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[133]" meta [DisplayName = "17300 - WIP-MATERIAL BURDEN"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[134]" meta [DisplayName = "17305 - WIP-MFG OVERHEAD BURDEN"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[135]" meta [DisplayName = "17310 - WIP-ENG OVERHEAD BURDEN"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[136]" meta [DisplayName = "17315 - LABOUR FRINGE BURDEN"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[137]" meta [DisplayName = "17320 - WSC OVERHEAD BURDEN"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[138]" meta [DisplayName = "17325 - SYS SOLUTIONS OH BURDEN"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[139]" meta [DisplayName = "17330 - START-UP OVERHEAD BURDEN"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[724]" meta [DisplayName = "17335 - BURDEN ADJUSTMENTS"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[140]" meta [DisplayName = "17350 - BURDEN RECLASS - WIP"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[141]" meta [DisplayName = "17351 - BURDEN RECLASS - FG"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[142]" meta [DisplayName = "17352 - BURDEN RECLASS - RM"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[143]" meta [DisplayName = "17353 - BURDEN RECLASS - CNTRCT"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[144]" meta [DisplayName = "17400 - WIP-OV/UND APLD ACRL T/FRM COS"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[146]" meta [DisplayName = "17490 - WIP-OVR/UND APPLD LAB FRINGE"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[147]" meta [DisplayName = "17492 - WIP-OVR/UND APPLD MATL FACTORS"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[149]" meta [DisplayName = "17496 - WIP-OV/UND APLD MFG LAB OH"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[150]" meta [DisplayName = "17497 - WIP-OV/UND APLD ENG/PMO LAB OH"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[151]" meta [DisplayName = "17498 - WIP-OVR/UND APPLD WSC SUPPORT"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[148]" meta [DisplayName = "17499 - WIP-OVR/UND APPLD SYS SOLNS"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[152]" meta [DisplayName = "17499 - WIP-OVR/UND APPLD SYS SOLNS"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[153]" meta [DisplayName = "17900 - DEMO ASSETS - OTHER"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[154]" meta [DisplayName = "17901 - DEMO ASSETS - PROJECTS"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[155]" meta [DisplayName = "17905 - CSG LOANERS"] or Cube.AttributeMemberId([CHART OF ACCOUNTS.LEDGER ACCOUNT AND DESCRIPTION]) = "[CHART OF ACCOUNTS].[LEDGER ACCOUNT AND DESCRIPTION].&[156]" meta [DisplayName = "17910 - DEMO RESERVE"])),
    #"Added Items1" = Cube.Transform(#"Filtered Rows",
        {
            {Cube.AddAndExpandDimensionColumn, "[TRANSACTION ENTRY DATE]", {"[TRANSACTION ENTRY DATE].[FISCAL].[FISCAL YEAR AND PERIOD]"}, {"TRANSACTION ENTRY DATE.FISCAL YEAR AND PERIOD"}}
        }),
    #"Filtered Rows1" = Table.SelectRows(#"Added Items1", each (Cube.AttributeMemberId([TRANSACTION ENTRY DATE.FISCAL YEAR AND PERIOD]) = "[TRANSACTION ENTRY DATE].[FISCAL].[FISCAL YEAR AND PERIOD].&[" & paramYr & "]&[" & paramMonth & "]" meta [DisplayName = "2019-03"]))
in
    #"Filtered Rows1"

参数如下(分别命名为paramMonth,paramYr和concatPeriod):

let
    Source = Excel.CurrentWorkbook(){[Name="paramMonth"]}[Content],
    FMonth = Record.Field(Source{0}, "Month")
in
    FMonth

let
    Source = Excel.CurrentWorkbook(){[Name="paramYr"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Year", type text}}),
    FYear = Record.Field(#"Changed Type"{0},"Year")
in
    FYear

let
    ConcatPeriod = paramYr & "-" & paramMonth
in
    ConcatPeriod

基本上,我试图输入变量以动态更新会计期间的数据,但是我要么得到“缺少模块引用”,要么没有得到返回的记录。当我在公式中手动将“ 2019”和“ 03”编码时,它将按预期加载。

参数看起来正确-它们是文本。

我不确定为什么这不起作用/如果我缺少所需的任何代码行。

2 个答案:

答案 0 :(得分:0)

您引用的参数为 paramYr paramMonth ,但是代码中的参数分别为 FYear FMonth

答案 1 :(得分:0)

从查询中删除这些行:

paramYr = paramYr,
paramMonth = paramMonth,
concatPeriod = concatPeriod,

M将引用其他查询中没有这些分配的值。