Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hello Everyone,
I have a quick question on Dataset Refresh in Power BI Service. I have created a Custom Connector, and set up the on-premises data gateway(Personal mode) for the Scheduled Refresh.
Note: I have included "TestConnection" in Code part as "TestConnection = (dataSourcePath) => { "CubeConnector.Contents" },"
The error which I am facing is as below: Its given in German Language, Error: "It says 0 Argument is given to Function, but it expects the Arguments between 4 and 5".
"Same Error I am getting when I execute the Custom Connector in Visual studio also.
Kindly provide some suggestion on this issue.
@Anonymous - Can you paste your M code from Advanced Editor?
Otherwise, You could check the Issues forum here:
https://community.powerbi.com/t5/Issues/idb-p/Issues
And if it is not there, then you could post it.
If you have Pro account you could try to open a support ticket. If you have a Pro account it is free. Go to https://support.powerbi.com. Scroll down and click "CREATE SUPPORT TICKET".
Hello @Greg_Deckler,
Thanks for your reply. I have raised the Support Ticket
I have a problem with Parameters on DataSet Refresh in PBI Service for the Custom Connector. I set the Parameters in PBI Desktop under 'Manage Parameters'.
But When I give the static (HardCoded) values in CustomConnector, Refresh working perfectly in PBI Service.
Note: In PBI Desktop, Refresh on CustomConnector works perfectly. Problem is only on PBI Service with 'Parameters'.
Here is my code:
shared CubeConnector.Contents = (Host as text, Port as number, Cube as text, Ansicht as text, optional Sprache as text) =>
let
lang = if (Sprache <> null) then Sprache else "L02",
// Restapi Query to fetch TM1 Data
url = "http://"& Host &":"& Number.ToText(Port) &"/api/v1/",
body = "{
}",
Source = Json.Document(Web.Contents(url, [Headers=[#"Content-Type"="application/json"], Content = Text.ToBinary(body), RelativePath = "Cubes('"& Cube &"')/Views('"& Ansicht &"')/tm1.Execute?$expand=Axes($expand=Hierarchies($select=Name),Tuples($expand=Members($select=Attributes/"&lang&"))),Cells($select=Value)"
])),
followed by some transformation which converts the cube data into the required Table Format.
Below is the input prompt for my custom connector in PBI Desktop:
Here is the query and Parameters
What am doing wrong, why In PBI Service there is no Parameter been set. Any Suggestions?
Hi @Anonymous ,
Would you please try to use Skip Test Connection option in data source settings:
After you publish to the Power BI Service you will not be able to refresh your dataset unless you turn on the “Skip Test Connection”, because the Power BI Service apparently strips out any query parameters from the url when it is testing the connection.
For more details, please refer to https://blog.crossjoin.co.uk/2019/04/25/skip-test-connection-power-bi-refresh-failures/ and https://blog.crossjoin.co.uk/2016/08/23/web-contents-m-functions-and-dataset-refresh-errors-in-power-bi/
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
Hi @v-deddai1-msft ,
Thanks for you reply. But I can't see "skip connection" option in 'DataSource Credentials window'.
Note: In custom connector code I have added: TestConnection = (dataSourcePath) => { "CubeConnector.Contents" } in Data Scourc Kind descption section.
One of my major problem is, Parameter are not visible[^^warning!^^ Parameters haven't been defined for this dataset yet. If you want to set parameters, use the Query Editor. Learn more], and I am using the on-premise-Gateway(Personal Mode).
Is that the problem with on-premise-Gateway(Personal Mode)? Should I need to install the other one and try?
Hi @Anonymous ,
Would you please try to set all the parameters' data type to text? And Woud you please try the following steps:
If the issue is still existing , please try to open a support ticket. If you have a Pro account it is free. Go to https://support.powerbi.com. Scroll down and click "CREATE SUPPORT TICKET".
Best Regards,
Dedmon Dai
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
34 | |
30 | |
18 | |
12 | |
8 |
User | Count |
---|---|
50 | |
35 | |
30 | |
14 | |
12 |