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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
astarner
Regular Visitor

Append new data to a history table without overwriting

I have created a history table with 2 years of data (copy and paste to create the table).  I have then created another query that will pull the auto created datasource containing new information to be formatted and what remains is only what i need.  I need to append one to the other on a weekly basis AND THEN STORE THIS INFO, without overwriting.  I need to build new history to continue to add to the history table.  In power query editor, no matter which way i slice this i cannot get it to SAVE the most recent data without overwriting it.  In my simple mind, i need to copy the new results and paste to the history table.  Note that this is a HANDS OFF query, i need it all to be automated.  Tons of posts everywhere about this, however i have yet to find a logical solution.  Any ideas?  Willing to attempt anything at this point!!! PLEASE!!!!!!

8 REPLIES 8
MrAnalyticy
Regular Visitor

Try using Power Automate to query your data (if that is possible using appropriate Actions like HTTP, SQL Server etc) then append the returned data to a Dataverse table. In Power BI you would, then, connect to that Dataverse table. 

 

BhupendraSingh
Regular Visitor

Issue: - In power BI Desktop/ Services only current data is appending to historic data and refreshing and as soon as we are adding new data it over writing previously appended data from excel.

On daily basis data is coming on in folder old file gets deleted in folder.

I created historic data (HistoricData – Serial Number from 1 to 10 ) with import of excel and changed its refresh property to false so this become our historic data.

When new file coming, I am refreshing it as Currentdata (Serial Number from 11 to 20). Now I am appending this by using union this CurrentData with HistoricData in new table as AllRecords as below.

 

AllData = UNION(SUMMARIZE(CurrentData,CurrentDate[Date],CurrentData[Serail Number]),SUMMARIZE(Historicdata,Historicdata[Date],Historicdata[Serail Number]))

 
 

 

On first append it works fine but as soon as I do next refresh with new date data (Serial Number from 21 to 30 ) it over write the data which was appended in last step and below.

 

 

Is feasible using excel in Power BI ?

Is the any approach from which I can achieve this ?

Using SQL approach reading data from excel and maintaining it there and connecting it with Powerbi will not work for me as columns are not fixed and these can increase frequently.

 

 

ImkeF
Super User
Super User

Sounds like you're looking for incremental load? This feature is available in Power BI Premium. If you don't have Premium, the workarounds depend on if you want to refresh it in the service or not. So do you want a solution that works in the service?

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Nolock
Resident Rockstar
Resident Rockstar

Hi @astarner,

without any example it was difficult to follow you, but I think you need the function Table.Combine, which appends tables one after each other.

If it doesn't solve your problem, please add an example what you actually have and what you expect. Thank you 🙂

I have MANY files (70+) that dump out of our ERP system daily and stored in sharepoint (tsv files).  7 of these files are point in time files where they are only good for the minute that they were ran.  for example, 1 file is open PO's.  I have power BI pulling in this file and formatting it.  Because i do not have another way to store the history, i have another query that is just a table that i have typed in the history on a weekly basis.  The end result of the daily dump is a query with 2 columns (a date, and a number), the history file is exactly the same (a date and a number).  I need to append the newly formatted file (query) to the history query on a weekly basis and not keep overwriting itself.  End goal is 1 query with weekly updates.  Sounds simple - but i cannot wrap my head around this!  Thank you for your help.

Safest thing is to export the consolidated data via R or Python to a file and append new data with every refresh. That would work in the service as well: https://www.thebiccountant.com/2016/02/09/how-to-create-a-load-history-or-load-log-in-power-query-or... 

 

Other worakaround that just work for Desktop are these: https://www.thebiccountant.com/2017/01/11/incremental-load-in-powerbi-using-dax-union/ or this: https://www.thebiccountant.com/2016/11/15/incremental-load-powerbi/ 

 

Just be aware that they all have their drawbacks.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

I  just made a go at the union - (joining the History and the New Data tables).  I see that it did combine them as expected - so i ran a new report out the the ERP system, and then did a refresh.  Almost as expected, it omitted what WAS in the new data query with todays data and THEN it joined this to the history file (so i am missing a week of data). I almost need to join them, create a new table with hard data and then have that cycle repeat weekly - however i do not believe there is a way to automate that..... is it?

No, you have to do this all manually. These are all pretty fiddly workarounds unfortunately.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors