Skip to content

Small program with graphical interface to create the necessary Power BI script and use it to view the dataflows, renaming the technical fields by functional values.

License

Notifications You must be signed in to change notification settings

caidevOficial/Python_PBI_Script_Maker

Repository files navigation

Logo SEA Team
Logo Python


Power BI Script Maker

Developed by: Facundo Falcone


Important: You`ll need Python 3.10.X

How to use:

As a first step, install the necessary libraries to run the program, for this you must execute the command in the console:

If you use windows:

py -m pip install -r requirements.txt

If you use UNIX:

python3 -m pip install -r requirements.txt

This command will install all the necessary libraries to run the program without problems.

As a second step, you should edit the file source_pbi_fields.xlsx Without erasing the red headers, from line 2 onwards, putting the technical names of the fields in the first column and their functional names in the second column.

xlsx file

As a third step, in the GUI you will have a textbox where you will put the name of the table for which you want to write the script and select from the combobox the dataset to which that table belongs. Once done, click on the blue button. This action will create a file with extension .vba which will contain the script to copy and paste it into Power BI.

Main GUI

The program will create a file like: dataset_name.table_name.vba which will contain the script to copy in the advanced settings of Power BI

let
    Source = GoogleBigQuery.Database([BillingProject = ProjectID, UseStorageApi = false]),
    Navigation = Source{[Name = DatalakeID]}[Data],
    #"Navigation 1" = Navigation{[Name = "dataset_number_2", Kind = "Schema"]}[Data],
    #"Navigation 2" = #"Navigation 1"{[Name = "pokemons", Kind = "Table"]}[Data],
    #"Renamed columns" = Table.RenameColumns(#"Navigation 2", {{"field_1", "Field Number 1"}, {"field_2", "Field Number 2"}, {"field_3", "Field Number 3"}, {"field_4", "Field Number 4"}, {"field_5", "Field Number 5"}, {"field_6", "Field Number 6"}, {"field_7", "Field Number 7"}, {"field_8", "Field Number 8"}, {"field_9", "Field Number 9"}, {"field_10", "Field Number 10"}, {"field_11", "Field Number 11"}, {"field_12", "Field Number 12"}, {"field_13", "Field Number 13"}, {"field_14", "Field Number 14"}, {"field_15", "Field Number 15"}, {"field_16", "Field Number 16"}, {"field_17", "Field Number 17"}})
in
    #"Renamed columns"

Technologies used. 📌

Pyhton Logo Python
Pandas Logo Pandas
Pygame Logo Pygame
VSCode Logo VSCode



About

Small program with graphical interface to create the necessary Power BI script and use it to view the dataflows, renaming the technical fields by functional values.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages