Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
darentengmfs
Post Prodigy
Post Prodigy

Unable to Connect to Data Source Undefined

[UPDATE BELOW]

Hi,

 

I am having this issue when refreshing a report that I have in Power BI Services.

 

Something went wrong
Unable to connect to the data source undefined.
Please try again later or contact support. If you contact support, please provide these details.
Underlying error code: -2147467259
Underlying error message: 5 arguments were passed to function which expects between 2 and 4.
DM_ErrorDetailNameCode_UnderlyingHResult: -2147467259
Microsoft.Data.Mashup.ValueError.Arguments: {Table.FromRecords({}), "Index", 0, 1, number}
Microsoft.Data.Mashup.ValueError.Reason: Expression.Error
Cluster URI: WABI-US-NORTH-CENTRAL-C-PRIMARY-redirect.analysis.windows.net
Activity ID: a206391b-cff3-452a-b437-01deca29af12
Request ID: 704c85c9-9939-4d9d-b584-2b1d0b14d9bc
Time: 2020-08-14 20:52:20Z

 

 

This report refreshes with no problem when I'm refreshing it using Power BI software, but it does not refresh in Services. Nothing is wrong with the query.

 

Any ideas?

 

[Update]

After removing each step I have done to get to my final outcome, I found out that the problem occurs when I add an index column in the query. I do not know why it causes the error as it is a built-in Power Query function. This step is crucial to get what I need so removing the step would not be an option.

 

Thanks!

Daren

1 ACCEPTED SOLUTION

Hi @Anonymous 

 

I have found the solution.

 

The problem lies within the Index Column formula itself. Notice that it has 5 parameters, the last one being "type int". The newer Power BI Desktop version automatically adds in the 5th parameter, which is the "type". If you remove that parameter completely, you will be able to refresh in Services. However, if you do not want to remove that parameter, you could simply update your Data Gateway to the latest version. Either one works.

 

Daren

View solution in original post

10 REPLIES 10
lbendlin
Super User
Super User

What do you think is causing this message?

 

Underlying error message: 5 arguments were passed to function which expects between 2 and 4

Hi @lbendlin 

 

I am not sure. This new query is referencing to another query with added new steps that does not seem to be the problem. I have added 3 calculated columns for that table with these formulas:

 

Running Total =

Calculate ( SUM('Cost'[Value]), ALL('Cost'),

'Cost'[Index] <= Earlier('Cost'[Index]))

 

and

 

Running Total % =

'Cost'[Running Total]/Sum('Cost'[Value])

 

and

 

Group = if('Cost'[Running Total %] <=0.3, "A", if(and('Cost'[Running Total %] > 0.3, 'Cost'[Running Total %] <= 0.6), "B", if('Cost'[Running Total %] > 0.6, "C", "Error")))

 

They all run just fine and refreshes just fine in Power BI.

Hi @darentengmfs ,

 

Please check the different privacy level settings in Power BI Desktop and Power BI Service. Make sure you have the same privacy level security:

 

In desktop:

Options and Settings --> Data Source Settings

For every Datasource: -->  Edit Permissions

Capture4.PNG

 

In service:

Datasets --> (Choose you Datasets which does not update properly) --> settings --> Gateway Connection --> Actions --> (expand you cluster to show all Data Sources) --> (Choose relevant Datasource) --> Advanced Settings --> Privacy setting

 

Capture5.PNG

 

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

 

I have edited the thread and there's an update to it.

 

Basically the problem arises when I added an index column in the query. This index column is needed to get what I need so removing it isn't an option for me.

Can you add the index in your data source, before ingesting the data in Power BI?

Hi @lbendlin 

 

The query with the index column is created by merging 2 other queries with multiple steps. I can try this but it will be my last resort if there's no other way.

Anonymous
Not applicable

I'd say that the poster shouldn't have to do this, and it isn't necessarily possible. I have the exact same issue. Same error message. I've run through some basic debugging and wanted to share it.

 

I can create a simple dataset referring to one table in a db. Make a quick visual and publish. Works fine.

 

I create a duplicate and add an index column. Refreshes fine in Desktop but once published and connected through a gateway it will not refresh, with the error message as posted originally. I tried this with two different source databases. The gateway has the same Organizational security level in both instances, just as a check. 

 

Is this a bug in Power BI? I can't see how I could be breaking anything by adding an index column.

 

Sam.

 

 

 

Hi @Anonymous 

 

I have found the solution.

 

The problem lies within the Index Column formula itself. Notice that it has 5 parameters, the last one being "type int". The newer Power BI Desktop version automatically adds in the 5th parameter, which is the "type". If you remove that parameter completely, you will be able to refresh in Services. However, if you do not want to remove that parameter, you could simply update your Data Gateway to the latest version. Either one works.

 

Daren

Hi @darentengmfs ,

 

Thank you for sharing the solution . Would you please Accept it as the solution to help the other members find it more quickly.



Best Regards,

Dedmon Dai




Hi @v-deddai1-msft 

 

I have set everything to organizational but it still does not refresh in Power BI services.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors