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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
kellyylx
Helper I
Helper I

Refresh data monthly and add new rows to original table

Hi my original table is data about product information and the countries they are sold to. 

 

Then I created this table below that shows the number of products sold in each country as of 29 November. 

YearMonthDayCountryCount of Products
20241129A2789
20241129B625
20241129C941

 

I want to keep track of the values every month to track how sales are going. 

 

Is there a way where I can schedule a monthly refresh and retreive the table below:

YearMonthDayCountryCount of Products
2024111A2789
2024111B625
2024111C941
2024121A2890
2024121B627
2024121C3711

 

such that the new rows are added to the original table. I want to do this so that plot some line graphs so track the sales monthly. 

 

6 REPLIES 6
FarhanJeelani
Super User
Super User

Hi @kellyylx ,

Yes, you can achieve this by combining Power BI with Power Automate or using a SQL-based solution if your data is stored in a database. Here's a straightforward way:

1. Using Power Automate with Power BI:

  • Set Up Your Power BI Dataset: Ensure the original data is connected to Power BI and includes a refresh mechanism (e.g., through DirectQuery or scheduled refresh).

  • Export Data on a Monthly Basis: Use Power Automate to export your Power BI table to a storage location (e.g., Excel, SharePoint, or SQL) on the 1st of every month.

    Steps:

    1. Create a Power Automate flow to trigger monthly.
    2. Use the "Export to File for Power BI Reports" connector to export the table.
    3. Append the exported data to an external file (e.g., Excel or SharePoint).
  • Re-Import Appended Data: Connect the external file back to Power BI, ensuring all appended data (historical + current) is loaded.

2. SQL-Based Solution:

If your data is stored in a database:

  1. Create a history table in the database to store monthly snapshots.
  2. Set up a scheduled query in the database (e.g., using SQL Server Agent) to:
    • Run on the 1st of every month.
    • Insert the current month's data into the history table using:
      INSERT INTO SalesHistory (Year, Month, Day, Country, CountOfProducts)
      SELECT Year, Month, Day, Country, COUNT(ProductID) AS CountOfProducts
      FROM OriginalTable
      WHERE Date = GETDATE()
      GROUP BY Year, Month, Day, Country;
  3. Connect the history table to Power BI for visualizations.

3. Power BI Only (Manual Workaround):

  • Use Power Query to load historical data from a static source (e.g., Excel or a CSV).
  • Refresh the data monthly, adding new rows to the static file manually.

For automation and scalability, Power Automate or SQL-based solutions are recommended.

 

Please accept this as solution, if it helps. Appreciate Kudos.

for Power Automate, is there any way such that i can power automate to the same excel file instead of creating a new file every time the refresh is scheduled?

Hi @kellyylx ,

 

I think you may try to trigger the refresh by Power Automate when your data source update .

For refernece:
Refresh your Power BI dataset using Microsoft Flow | Microsoft Power BI Blog | Microsoft Power BI

Solved: How to automatically refresh power bi report once ... - Microsoft Fabric Community

 

Best Regards,
Rico Zhou

 

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

danextian
Super User
Super User

Hi @kellyylx 

Power BI doesn't have an option for a monthly refresh, only weekly and daily. But this can be done using a Power Automate flow. For your other question, if you're meaning to keep a historical version of your data with each refresh. Power BI can't do that. Power BI does not retain historical versions of the data; it replaces the stored data with the current state of the source during each refresh. If you want the historical version, this data must also be available. You can use Power Automate to run a query against a dataset, store that as a flat file in a sharepoint folder and and use that as a data source along with the most recent data.










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

for Power Automate, is there any way such that i can power automate to the same excel file instead of creating a new file?

Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the link down below.

 

Configure scheduled refresh - Power BI | Microsoft Learn

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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