Forum Discussion

KrzysztofK's avatar
KrzysztofK
Frequent Visitor
5 years ago
Solved

SAP HANA Message Server - Using list declared list elements as parameter for query

Hello! 

I am working on self-updating report based on SAP HANA Message Server, I am relatively new with using this datasource and have some problems with understanding logic of Cube.* functions:

Issue 1
My Data Provider requires to be provided with several parameters - most of them can be set up manually, since they will never or rarely be changed, but I want the last parameter (Fiscal period) to be adjustable going forward. Is it possible to implement any kind of logic into Cube.ApplyParameter () concerning the fact that format expects you to provide a list of values in {{}} ?

So far I tried:
1. Creating a a list parameter which stores the text values of Fiscal Period in format understandable for SAP:


Unfortunately, when revoked in code this variable only returns results for the value in 'Current Value', instead of using all list elements as a criteria.


2. Creating a query parameter which generates similar list of values through query (I wanted to check whether I use this object correctly).

 

 Unfortunately, the results were the same - only items that comply with 'Current Value' are being displayed, instead of as I would expect all values from the list which is the result of this query. 

 

Here's how the variable is embedded in query:

 

Maybe there is a simple way of doing this ?

 

Issue 2

Other thing I'd like to know is whether when we specify columns and measures and we don't need the underlying data, just aggregate of Row.Numbers() type - can we specify this while during initial data pull, or as I do currently - do the groupping in next step in PBi transformation.


Appreciate your help! 

  • KrzysztofK's avatar
    KrzysztofK
    5 years ago

    Hello, 

    So it turns out I was on a right track to resolve it. What finaly worked was: 
    1. create a query that contained values I wanted to act as parameters, make sure at the end of the transformation you change it to list:

    2. Replace text parameter with query in code:

     

    {Cube.ApplyParameter, "[!V000003]", {#"Period list"}},


    This worked like a charm, and using simple logic based on DateTime.IsNow() you can easily make the list self updated. 


     

3 Replies

  • KrzysztofK's avatar
    KrzysztofK
    Frequent Visitor

    UPDADE: 

    Instead of using Parameter as a list storage i gave reference straitght to query result with below error:


    Feedback Type:
    Frown (Error)

    Error Message:
    Specified method is not supported.

    Stack Trace:
    Microsoft.Mashup.Evaluator.Interface.ErrorException: Specified method is not supported. ---> Microsoft.Mashup.Evaluator.Interface.ErrorException: Specified method is not supported. ---> Microsoft.Mashup.Evaluator.Interface.ErrorException: Specified method is not supported. ---> Microsoft.Mashup.Evaluator.Interface.ErrorException: Specified method is not supported. ---> Microsoft.Mashup.Evaluator.Interface.ErrorException: Specified method is not supported. ---> System.NotSupportedException: Specified method is not supported. ---> System.NotSupportedException: Specified method is not supported.
    at Microsoft.Mashup.Engine1.Library.SapBusinessWarehouse.SapBwCubeExpressionMdxCompiler.CompileSelectionOptionVariable(SapBwVariable variable, ParameterArguments arguments)
    at Microsoft.Mashup.Engine1.Library.SapBusinessWarehouse.SapBwCubeExpressionMdxCompiler.CompileVariable(SapBwVariable variable, ParameterArguments arguments)
    at Microsoft.Mashup.Engine1.Library.SapBusinessWarehouse.SapBwCubeExpressionMdxCompiler.CompileVariables()
    at Microsoft.Mashup.Engine1.Library.SapBusinessWarehouse.SapBwCubeExpressionMdxCompiler.TryCompile(QueryCubeExpression expression, RowRange rowRange, MdxExpression& mdx, Dictionary`2& aliases)
    at Microsoft.Mashup.Engine1.Library.SapBusinessWarehouse.SapBwCubeExpressionMdxCompiler.CanCompile(QueryCubeExpression expression, Dictionary`2& aliases)
    at Microsoft.Mashup.Engine1.Library.SapBusinessWarehouse.SapBwCubeContextProvider.TryCreateContext(QueryCubeExpression expression, IList`1 parameters, Boolean cacheResults, Boolean newConnection, CubeContext& context)
    at Microsoft.Mashup.Engine1.Library.SapBusinessWarehouse.SapBwCubeContextProvider.TryCreateContext(QueryCubeExpression expression, IList`1 parameters, CubeContext& context)
    at Microsoft.Mashup.Engine1.Library.Cube.CubeContextCubeValue.ApplyParameter(FunctionValue parameter, Value[] args)
    at Microsoft.Mashup.Engine1.Library.Cube.CubeParametersModule.Cube.ApplyParameterFunctionValue.TypedInvoke(TableValue cube, Value parameter, Value arguments)
    at Microsoft.Mashup.Engine1.Runtime.NativeFunctionValue3`4.Invoke(Value arg0, Value arg1, Value arg2)
    at Microsoft.Mashup.Engine1.Library.Cube.CubeModule.Cube.TransformFunctionValue.TypedInvoke(TableValue cube, ListValue transforms)
    at Microsoft.Mashup.Engine1.Runtime.NativeFunctionValue2`3.Invoke(Value arg0, Value arg1)
    at Microsoft.Mashup.Engine1.Language.DebugInstruction.Execute(MembersFrame1& frame)
    at Microsoft.Mashup.Engine1.Language.FunctionInvocationInstruction2.Execute(MembersFrame1& frame)
    at Microsoft.Mashup.Engine1.Language.DebugInstruction.Execute(MembersFrame1& frame)
    at Microsoft.Mashup.Engine1.Language.InstructionInvocationInstruction2.Execute(MembersFrame1& frame)
    at Microsoft.Mashup.Engine1.Language.DebugInstruction.Execute(MembersFrame1& frame)
    at Microsoft.Mashup.Engine1.Language.MembersFunctionValue1.Invoke(Value arg0)
    at Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.Force(Int32 index)
    at Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.get_Item(Int32 index)
    at Microsoft.Mashup.Engine1.Language.MembersFunctionValue1.Invoke(Value arg0)
    at Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.Force(Int32 index)
    at Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.get_Item(Int32 index)
    at Microsoft.Mashup.Engine1.Runtime.Library.Linker.BindFunctionValue.TypedInvoke(RecordValue environment, Value section, TextValue name)
    at Microsoft.Mashup.Engine1.Runtime.NativeFunctionValue3`4.Invoke(Value arg0, Value arg1, Value arg2)
    at Microsoft.Mashup.Engine1.Language.MembersFunctionValue0.Invoke()
    at Microsoft.Mashup.Engine1.Language.ListInstruction.RuntimeListValue.Force(Int32 index)
    at Microsoft.Mashup.Engine1.Language.ListInstruction.RuntimeListValue.get_Item(Int32 index)
    at Microsoft.Mashup.Engine1.Language.MembersFunctionValue1.Invoke(Value arg0)
    at Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.Force(Int32 index)
    at Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.get_Item(Int32 index)
    at Microsoft.Mashup.Engine1.Language.FunctionInvocationInstruction2.Execute(MembersFrame1& frame)
    at Microsoft.Mashup.Engine1.Language.Instruction.ExecuteCondition(MembersFrame1& frame)
    at Microsoft.Mashup.Engine1.Language.DebugInstruction.ExecuteCondition(MembersFrame1& frame)
    at Microsoft.Mashup.Engine1.Language.IfInstruction.Execute(MembersFrame1& frame)
    at Microsoft.Mashup.Engine1.Language.DebugInstruction.Execute(MembersFrame1& frame)
    at Microsoft.Mashup.Engine1.Language.MembersFunctionValue1.Invoke(Value arg0)
    at Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.Force(Int32 index)
    at Microsoft.Mashup.Engine1.Language.RecordInstruction.RuntimeRecordValue.get_Item(Int32 index)
    at Microsoft.Mashup.Engine1.Language.MembersFunctionValue0.Invoke()
    at Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator.BeginGetResult(DocumentEvaluationParameters parameters, Action`1 callback)
    --- End of inner exception stack trace ---
    at Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator.BeginGetResult(DocumentEvaluationParameters parameters, Action`1 callback)
    at Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator.BeginGetResult(DocumentEvaluationParameters parameters, Action`1 callback)
    at Microsoft.Mashup.Evaluator.FirewallPartition.BeginGetResult[T](Action`1 callback)
    at Microsoft.Mashup.Evaluator.FirewallDocumentEvaluator.Evaluation`1.OnBufferComplete(Exception exception)
    at Microsoft.Mashup.Evaluator.Firewall.BeginBufferPartitions(Action`1 callback)
    at Microsoft.Mashup.Evaluator.FirewallDocumentEvaluator.BeginGetResultInternal[T](DocumentEvaluationParameters parameters, Action`1 callback)
    at Microsoft.Mashup.Evaluator.Interface.IDocumentEvaluatorExtensions.GetResult[T](IDocumentEvaluator`1 evaluator, DocumentEvaluationParameters parameters)
    at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetResult[T](IMessageChannel channel, BeginGetResultMessage message, Action`1 action)
    at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetPreviewValueSource(IMessageChannel channel, BeginGetPreviewValueSourceMessage message)
    at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
    at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
    at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
    at Microsoft.Mashup.Evaluator.ChannelMessenger.OnMessageWithUnknownChannel(IMessageChannel baseChannel, MessageWithUnknownChannel messageWithUnknownChannel)
    at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
    at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
    at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
    at Microsoft.Mashup.Evaluator.EvaluationHost.Run()
    at Microsoft.Mashup.Container.EvaluationContainerMain.Run(Object args)
    at Microsoft.Mashup.Evaluator.SafeThread2.<>c__DisplayClass9_0.<CreateAction>b__0(Object o)
    at Microsoft.Mashup.Container.EvaluationContainerMain.SafeRun(String[] args)
    at Microsoft.Mashup.Container.EvaluationContainerMain.Main(String[] args)
    --- End of inner exception stack trace ---
    at Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator.<>c__DisplayClass3_0.<BeginGetResult>b__0(EvaluationResult2`1 result)
    --- End of inner exception stack trace ---
    at Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator.<>c__DisplayClass3_0.<BeginGetResult>b__0(EvaluationResult2`1 result)
    at Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator.BeginGetResult(DocumentEvaluationParameters parameters, Action`1 callback)
    at Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator.BeginGetResult(DocumentEvaluationParameters parameters, Action`1 callback)
    at Microsoft.Mashup.Evaluator.FirewallPartition.BeginGetResult[T](Action`1 callback)
    at Microsoft.Mashup.Evaluator.FirewallDocumentEvaluator.Evaluation`1.OnBufferComplete(Exception exception)
    at Microsoft.Mashup.Evaluator.Firewall.BeginBufferPartitions(Action`1 callback)
    at Microsoft.Mashup.Evaluator.FirewallDocumentEvaluator.BeginGetResultInternal[T](DocumentEvaluationParameters parameters, Action`1 callback)
    at Microsoft.Mashup.Evaluator.Interface.IDocumentEvaluatorExtensions.GetResult[T](IDocumentEvaluator`1 evaluator, DocumentEvaluationParameters parameters)
    at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetResult[T](IMessageChannel channel, BeginGetResultMessage message, Action`1 action)
    at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetPreviewValueSource(IMessageChannel channel, BeginGetPreviewValueSourceMessage message)
    at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
    at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
    at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
    at Microsoft.Mashup.Evaluator.ChannelMessenger.OnMessageWithUnknownChannel(IMessageChannel baseChannel, MessageWithUnknownChannel messageWithUnknownChannel)
    at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
    at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
    at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
    at Microsoft.Mashup.Evaluator.EvaluationHost.Run()
    at Microsoft.Mashup.Container.EvaluationContainerMain.Run(Object args)
    at Microsoft.Mashup.Evaluator.SafeThread2.<>c__DisplayClass9_0.<CreateAction>b__0(Object o)
    at Microsoft.Mashup.Container.EvaluationContainerMain.SafeRun(String[] args)
    at Microsoft.Mashup.Container.EvaluationContainerMain.Main(String[] args)
    --- End of inner exception stack trace ---
    at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.<>c__DisplayClass9_1.<OnBeginGetPreviewValueSource>b__1()
    at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.<>c__DisplayClass0_0.<RunStub>b__0()
    at Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Action action)
    --- End of inner exception stack trace ---
    at Microsoft.Mashup.Evaluator.EvaluationHost.<>c__DisplayClass11_0.<TryReportException>b__1()
    at Microsoft.Mashup.Common.SafeExceptions.IgnoreSafeExceptions(IEngineHost host, IHostTrace trace, Action action)
    at Microsoft.Mashup.Evaluator.EvaluationHost.TryReportException(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Exception exception)
    at Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Action action)
    at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.RunStub(IEngineHost engineHost, IMessageChannel channel, Func`1 getPreviewValueSource)
    at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.<>c__DisplayClass12_1`1.<OnBeginGetResult>b__0()
    at Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Action action)
    at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetResult[T](IMessageChannel channel, BeginGetResultMessage message, Action`1 action)
    at Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetPreviewValueSource(IMessageChannel channel, BeginGetPreviewValueSourceMessage message)
    at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
    at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
    at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
    at Microsoft.Mashup.Evaluator.ChannelMessenger.OnMessageWithUnknownChannel(IMessageChannel baseChannel, MessageWithUnknownChannel messageWithUnknownChannel)
    at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
    at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
    at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
    at Microsoft.Mashup.Evaluator.EvaluationHost.Run()
    at Microsoft.Mashup.Container.EvaluationContainerMain.Run(Object args)
    at Microsoft.Mashup.Evaluator.SafeThread2.<>c__DisplayClass9_0.<CreateAction>b__0(Object o)
    at Microsoft.Mashup.Container.EvaluationContainerMain.SafeRun(String[] args)
    at Microsoft.Mashup.Container.EvaluationContainerMain.Main(String[] args)
    --- End of inner exception stack trace ---
    at Microsoft.Mashup.Evaluator.EvaluationHost.OnException(IEngineHost engineHost, IMessageChannel channel, ExceptionMessage message)
    at Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)
    at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
    at Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)
    at Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)
    at Microsoft.Mashup.Evaluator.Interface.IMessageChannelExtensions.WaitFor[T](IMessageChannel channel)
    at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.PreviewValueSource.WaitFor(Func`1 condition, Boolean disposing)
    at Microsoft.Mashup.Evaluator.RemotePreviewValueSource.PreviewValueSource.get_TableSource()
    at Microsoft.Mashup.Evaluator.Interface.TracingPreviewValueSource.get_TableSource()
    at Microsoft.Mashup.Host.Document.Analysis.PackageDocumentAnalysisInfo.PackagePartitionAnalysisInfo.SetPreviewValue(EvaluationResult2`1 result, Func`1 getStaleSince, Func`1 getSampled)

    Stack Trace Message:
    Specified method is not supported.

    Invocation Stack Trace:
    at Microsoft.Mashup.Host.Document.ExceptionExtensions.GetCurrentInvocationStackTrace()
    at Microsoft.Mashup.Client.UI.Shared.StackTraceInfo..ctor(String exceptionStackTrace, String invocationStackTrace, String exceptionMessage)
    at Microsoft.PowerBI.Client.Windows.Telemetry.PowerBIUserFeedbackServices.GetStackTraceInfo(Exception e)
    at Microsoft.PowerBI.Client.Windows.Telemetry.PowerBIUserFeedbackServices.ReportException(IWindowHandle activeWindow, IUIHost uiHost, FeedbackPackageInfo feedbackPackageInfo, Exception e, Boolean useGDICapture)
    at Microsoft.Mashup.Client.UI.Shared.UnexpectedExceptionHandler.<>c__DisplayClass15_0.<HandleException>b__0()
    at Microsoft.Mashup.Client.UI.Shared.UnexpectedExceptionHandler.HandleException(Exception e)
    at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
    at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
    at System.Delegate.DynamicInvokeImpl(Object[] args)
    at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
    at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
    at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
    at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
    at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
    at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
    at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
    at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
    at Microsoft.Mashup.Client.UI.Shared.WindowManager.ShowModal[T](T dialog, Func`1 showModalFunction)
    at Microsoft.PowerBI.Client.Program.<>c__DisplayClass4_0.<Main>b__1()
    at Microsoft.PowerBI.Client.Windows.IExceptionHandlerExtensions.<>c__DisplayClass3_0.<HandleExceptionsWithNestedTasks>b__0()
    at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
    at Microsoft.PowerBI.Client.Program.Main(String[] args)


    PowerBINonFatalError:
    {"AppName":"PBIDesktop","AppVersion":"2.88.1144.0","ModuleName":"","Component":"Microsoft.Mashup.Engine1.Library.SapBusinessWarehouse.SapBwCubeExpressionMdxCompiler","Error":"System.NotSupportedException","MethodDef":"CompileSelectionOptionVariable","ErrorOffset":""}

    Snapshot Trace Logs:
    C:\Users\P00066428\AppData\Local\Microsoft\Power BI Desktop\FrownSnapShot76e8a5ec-e0b1-4c8f-ad99-6ad3c81a3b5a.zip

    Model Default Mode:
    Import

    Model Version:
    PowerBI_V3

    Is Report V3 Models Enabled:
    True

    Performance Trace Logs:
    C:\Users\P00066428\AppData\Local\Microsoft\Power BI Desktop\PerformanceTraces.zip

    Enabled Preview Features:
    PBI_NewWebTableInference
    PBI_v3ModelsPreview
    PBI_dynamicParameters

    Disabled Preview Features:
    PBI_shapeMapVisualEnabled
    PBI_SpanishLinguisticsEnabled
    PBI_JsonTableInference
    PBI_ImportTextByExample
    PBI_ExcelTableInference
    PBI_qnaLiveConnect
    PBI_eimInformationProtectionForDesktop
    PBI_azureMapVisual
    PBI_dataPointLassoSelect
    PBI_compositeModelsOverAS
    PBI_narrativeTextBox
    PBI_anomalyDetection
    PBI_newFieldList
    PBI_cartesianMultiplesAuthoring

    Enabled DirectQuery Options:
    TreatHanaAsRelationalSource

    Cloud:
    GlobalCloud

    PowerBINonFatalError_ErrorDescription:
    Microsoft.Mashup.Host.Document.Evaluation.ErrorEvaluationResult

    PowerBIUserFeedbackServices_IsReported:
    True

    Formulas:


    Code = Source[Code]
    in
    Code;





     

  • v-robertq-msft's avatar
    v-robertq-msft
    Community Support

    Hi, KrzysztofK 

    I’m not very familiar with connecting to SAP HANA Message Server and using list declared list elements as a parameter for the query, you can check these cases and documents and find if it can make any help:

    https://docs.microsoft.com/en-us/power-query/connectors/sap-bw/message-setup-and-connect

    https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-sap-bw-connector

    https://answers.microsoft.com/en-us/msoffice/forum/msoffice_excel-mso_other-mso_2016/unexpected-error-power-query-specified-method-is/1a2eb905-6cf7-405f-b9bf-c47b7cbd0558

    If they can’t help you, I suggest you to @ some top kudoed/solution authors to help you so that your case can get more attention.

    How to Get Your Question Answered Quickly 

     

    Best Regards,

    Community Support Team _Robert Qin

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • KrzysztofK's avatar
      KrzysztofK
      Frequent Visitor

      Hello, 

      So it turns out I was on a right track to resolve it. What finaly worked was: 
      1. create a query that contained values I wanted to act as parameters, make sure at the end of the transformation you change it to list:

      2. Replace text parameter with query in code:

       

      {Cube.ApplyParameter, "[!V000003]", {#"Period list"}},


      This worked like a charm, and using simple logic based on DateTime.IsNow() you can easily make the list self updated.