Forum Discussion

lardo5150's avatar
lardo5150
Microsoft Employee
6 years ago

Self Sourcing Query and Data Refresh issue - Excel

So, here is what I am trying to accomplish:

 

I have a tool, that exports a list of cases that an engineer closed.  

Things include case number, time, etc.

The tool goes back 180 days.

 

If I were to export this every day, the new file will be different from the one I did the previous day.

created files will have the same column headers each time.

OwnerEmail,CompanyName,InternalTitle,ClosedDateTime

 

So here is what I am looking to do, in order to import new data each time, while preserving existing data and keep from creating duplicates.

 

First import of this file called ClosedCases.xls

Each time this file is created it is called the same thing, ClosedCases.xls

 

Tomorrow, the file is created, and we import it (would like it to be a data refresh so it is scheduled).

We look at the ClosedDateTime.  If any of those values match what is in the TARGET (our main file we are using), then we do not import those rows from the SOURCE (the newly created file).

We then import everything else.

 

I was following @ikalawski link he gave me below:

 

https://www.thebiccountant.com/2016/02/09/how-to-create-a-load-history-or-load-log-in-power-query-or-power-bi/ 

 

I am having a potential of two issues.

First, when I tried to point the spreadsheet at itself, I kept getting an error.

So I followed his steps in that article.

Created a Duplicate of CasesClosed.  I renamed it to ClosedResults

I set it up to append CasesClosed.

The source though for ClosedResults, is pointing to the same source as CasesClosed.  So I found it was just an exact copy of the data, it was not appending it.

In his steps, he has you changing the source to:

= Excel.CurrentWorkbook(){[Name="Result"]}[Content]

"result" being what he used, but I am assuming this would be ClosedResults for me.

the problem is no matter how I change it, I keep getting errors.

The source for CasesClosed and Closedresults looks like this right now:

= Excel.Workbook(Web.Contents("https://microsoft-my.sharepoint.com/something/something/Documents/ClosedCases.xlsx"), null, true)

I tried a few ways, but kept getting an error bout 0 arguments were passed to a function which expects 1 and 2

 

So I created a copy of the ClosedCases excel file in the same one drive folder I am pulling from and called it ClosedResults.xls.

I then changed it in PowerBi.

That seems to be working......

In the desktop PowerBi, I can do a data refresh.  It seems to be working.

When I publish it up to the Service though and try to do any kind of refresh, it fails immediately.

 

Data source error:{"error":{"code":"ModelRefresh_ShortMessage_ProcessingError","pbi.error":{"code":"ModelRefresh_ShortMessage_ProcessingError","parameters":{},"details":[{"code":"Message","detail":{"type":1,"value":"Information is needed in order to combine data"}}],"exceptionCulprit":1}}} Table: ClosedResults.

 

6 Replies