emantzoo's avatar
emantzoo
New Member
4 months ago

No-click Power BI dashboards built from Python scripts - Code-first

I built an open-source repo that generates complete, multi-page Power BI dashboards from Python scripts — no dragging fields, no clicking through menus.

 

How it works: A Python script uses make_* helper functions (one line per visual) to write visual.json files directly into the PBIR folder structure of a .pbip project. Open the project in Power BI Desktop and all pages appear with data-bound visuals ready to polish.

 

One line of Python:

make_card("sc1_rev", 20, 10, 295, 110, "_Measures", "Total Revenue")

...generates the full PBIR JSON for a data-bound KPI card.

 

Optional: auto-generate everything with a Claude skill

The repo includes a Claude skill file that can generate both the data model spec and the Python script from your raw CSVs + a one-paragraph business brief. You drop your CSVs into Claude Code, describe what you want ("supply chain dashboard tracking fulfillment, inventory, and supplier performance with YoY comparisons"), and it produces both files. You review the DAX measures and relationships before executing anything — the spec file acts as a human-readable checkpoint. You can also use the skill to generate just one of the two files and write the other yourself. The skill is optional — everything works fully manually without it.

 

Why code-first over the UI?

  • Reproducible — rerun the script, same dashboard every time. Text-based, version-controllable, JSON diffs instead of binary .pbix blobs
  • Fast — 4 dashboards built in under an hour vs days of manual work
  • Scalable — change a table name, rerun, done. Same layout, different data


    Now working on integrating nicer formats and R plots! 

 

Pure Python, no dependencies (just stdlib). Requires Power BI Desktop with PBIR preview features enabled.

GitHub: [LINK]

Would love to get your feedback!

 

No RepliesBe the first to reply