I am a beginner and doing the very first project in Power Automate, Power Apps and Power BI, so I will request you to kindly help me. My task is this -
- I am provided an excel file called source.xlsx which i kept in my local folder called Dev.
- I have written a python script (present in Dev folder) called generate.py.
- This script reads data from source.xlsx, does required work and generates a new pandas dataframe "dfOutput". I store dfOutput in a csv file called output.csv (present in Dev folder).
Code Snippets from generate.py-
import datetime
from dateutil.relativedelta import relativedelta
import pandas as pd
import numpy as np
import openpyxl
import warnings
warnings.filterwarnings("ignore")
def formatUtilityFunction(value):
value = value.replace('.', 0)
value = value.replace('', 0)
return value
#main
df = pd.read_excel("source.xlsx",sheet_name="Input1",header=1,usecols=['Quantity','PurchaseDate','CostPrice','SellPrice'])
df[['CostPrice','SellPrice']]=df[['CostPrice','SellPrice']].apply(formatUtilityFunction)
# more code to generate a new dataset by reading data from df and doing further work
dfOutput=pd.DataFrame(data,columns=[,'MonthYear','MonthlyCP','MonthlySP'])
dfOutput.to_csv("output.csv",index=False)
- I load output.csv into Power BI and create bar graph.
My roadblocks-
As-Is: I am manually running generate.py to produce output.csv and I manually load that into Power BI.
To-Be:
- The python script needs to be automatically triggered to regenerate output.csv whenever some change is noted in source.xlsx.
- Also, the graph in Power BI needs to be updated automatically if output.csv changes.
- BIGGEST CONCERN : I am not allowed to use any server or cloud for hosting the python script, in the final project.(Currently its running in my own computer)
So my concerns -
- where will my Python script run
- where will it store the output.csv file
- how will I build the entire dataflow?
I can use only Power Apps, Power Automate, Power BI.
I can find from sources that Power Automate has a capability of running very simple Python 2 scripts (I am using Python 3 , pandas, numpy )and stores some simple output in a variable, not csv file.
Do I really need to use Power Automate or Power Apps or only Power BI can tackle the requirements on its own?
If I need to use Power Automate or Power apps, how will I implement the requirements?
I am a novice and getting extremely overwhelmed.
Kindly help. Please.