Forum Discussion
PowerBI Service Dataflow & Datamart & PowerBI Desktop
Dear Anonymous,
thank you for your quick reply. I appreciate your tips. Again that's a good solution of yours which you propose for dynamic data to be stored in a file in my sharepoint desktop folder. Indeed, I haven't done any storage of this updated data because I thought it could be appended directly to a dataflow dataset and then the updated dataflow dataset could be used by datamarts directly and could be saved in datamarts each day (then the next day, it would upload archived data would delete already present archived data with a "remove_duplicates" step and + would upload just a new date). I understood now that dataflow doesn't save documents but I thought datamarts did so. So my update function here below is supposed to update and append new data into an archived dataset each day but only in dataflows :
Hi zhanna27 , ok, sorry I missed the part where you said in the original post that the dynamic data is loaded from an API rather than CSV files. So, is it an API call to a database or something else? Can you query more data through the API than just a single day? I can see in your function you are querying the data based on two dates, so can't you just query the data since the static data ends (mid-Dec 23)? If there is too much data for the API to handle, you could probably multiply the queries and load, e.g. a month at a time. Also, if the data is coming from a Database, can't you just use the DB (e.g. SQL connector in Dataflow, so then you can use normal SQL query to import all the data you need)? This would be probably the simplest solution as an SQL query should handle millions of rows of data, so you could probably do it in a single query.
I assume that from time to time data which you currently loading dynamically are dumped to the csv files (e.g. every year?) so then you would need to amend the dynamic data query date range.
As for the storage options, I don't think there is anything like that in PowerBI itself. I am not sure why specifically you are using Datamarts. In my experience, Dataflows work faster when loading data, and I don't find them very useful apart from one single feature, which gives you an SQL endpoint to query the data from Datamart.
You could use a database to store the data, but first you would still need to extract the data from your API. There are a couple of ways how you could automate this depending on what tools you have access to. One example might be to use PowerAutomate, which can run on a schedule every day and export the data from API and either upload it to a Database, Datamart, or SharePoint List or just save it as a .csv or .xlsx file where from you can load the data into your 'dynamic' dataflow. However, there would be some limits on the amount of data you can handle with PowerAutomate, so if you have millions of rows every day, this may not work. Another more advanced solution would be to use Azure DataFactory (if you have access to Azure). In the ADF, you can create a pipeline which will run every day, export the data from API and load it into, for example, the Azure SQL database.