Skip to content
Contact us

Set up Power BI on your own PC

Edition

Power BI comes with an Enterprise or Enterprise+ licence. See Editions: Professional, Enterprise and Enterprise+

The SMART Migration installer sets up everything on the SMART Migration server itself, so SMART BI.pbix refreshes there out of the box. Any other Windows PC that can reach the BI database refreshes it just as well — a consultant's laptop, a project manager's workstation — once it has four things.

PieceWhat it is for
Power BI DesktopMicrosoft's free app that opens and refreshes the report.
PostgreSQL ODBC driver (64-bit)What Power BI reads the PostgreSQL BI database through.
The SMARTBI data sourceThe ODBC data source the report reads from: it names the BI database's server, port and database.
The reportSMARTBI_Files.pbit, the report template shipped with the app, or any refreshed SMART BI.pbix from the Dashboard.

With all four on the PC, nobody has to wait for someone else to refresh and upload the report: open it and click Refresh.

Every download is in one dialog: on the Settings tab, in the Power BI section below Who can use the app, click Set up Power BI on this PC …; Power BI, after Refresh at the top of every tab, opens it too. It has two parts.

Everything is set up and ready

The SMART Migration installer has installed Power BI Desktop, the PostgreSQL ODBC driver and the SMARTBI data source on the SMART Migration server. Only the report is needed: Download report template downloads SMARTBI_Files.pbit, a Power BI template without data. Once it has downloaded, the app says what to do next: see Open the report template

Four steps, once per PC.

  1. Power BI Desktop

    Get Power BI Desktop (free) opens Microsoft's page in a new tab. It is free from Microsoft, with no licence needed, for Windows 10 or 11.

  2. PostgreSQL ODBC driver

    Download the PostgreSQL ODBC driver downloads the latest 64-bit driver, psqlodbc_x64.msi, from the PostgreSQL project. Run it on the PC; installing a driver needs administrator rights there.

  3. The SMARTBI ODBC data source

    Copy the script with the button in the corner of its box, and run it as administrator in PowerShell 5.1 or later — PowerShell ISE, Visual Studio Code or any editor that runs PowerShell. Its last line is green when SMARTBI is ready, yellow when the PC cannot reach the BI database.

  4. The report

    Download report template downloads SMARTBI_Files.pbit. Once it has downloaded, the app says what to do next: see Open the report template

The dialog shows where the data source will point: the SMART Migration server, port 5432, database SMARTBI.

The template or a refreshed copy

The template holds no data: Power BI Desktop loads it from the BI database as it opens. A refreshed SMART BI.pbix from Nextcloud Files works just as well: it opens with the data of its own refresh, and refreshes from the same SMARTBI data source.

SMARTBI_Files.pbit is a Power BI template: it holds the report without data. When Download report template has finished, the app opens Open the report template, a dialog with the four steps below and Power BI's own dialog as it looks.

  1. Open the template

    Double-click SMARTBI_Files.pbit where the browser saved it, usually the Downloads folder. Power BI Desktop creates a new, untitled report from it and connects to the BI database through the SMARTBI data source. Each time the template is opened, it makes a new report.

  2. Choose Default or Custom, then Connect

    The first time on a PC, Power BI Desktop asks how to connect to the ODBC data source SMARTBI. Click the Default or Custom tab, then Connect, and leave its field empty: the user and password are in SMARTBI already.

  3. If the first load fails, refresh

    The first load of the data may fail: a limitation of Power BI. Click Refresh on the Home tab, in the toolbar, and the data loads.

  4. Save the report

    The report is a file like any other: save it under any name, at any time — SMART BI.pbix, for instance.

Important: Default or Custom, then Connect

Power BI Desktop may open its dialog on another tab, such as Database, which asks for a user name and password. Do not type them there: click Default or Custom, then Connect. Power BI remembers the choice on that PC, so it asks only once.

Wrong tab: Database. Power BI may open on this tab first. Do not type a user name or password here: click Default or Custom on the left.

Right tab: Default or Custom. Leave the field empty and click Connect.

A saved report holds the data of its last refresh and needs nothing else: it opens anywhere, without the BI database, and can be shared like any other document. Each copy saved is a snapshot of the data as it was; Refresh brings it up to date on a PC that reaches the BI database. See Refresh, save and share SMART BI.pbix

The script is written by your browser from what the app knows; the app's server sends nothing anywhere. The dialog shows it in full, each step commented, with a copy button in its corner, and it reports each step on screen as it goes:

  • Checks that it runs as administrator. SMARTBI is a system data source, for every user of the PC, as on the SMART Migration server.
  • Checks the driver. Without the 64-bit PostgreSQL driver, it says so, opens the driver's download and stops.
  • Creates the SMARTBI data source, or points the one already there at the BI database — and asks for the server's name when SMART Migration has not reported one.
  • Reads SMARTBI back and checks it holds the server, the port and the database.
  • Stores the PostgreSQL user and password, the installer's postgres and admin, as on the SMART Migration server; change them at the top of the script when yours differ.
  • Tries the server's port, and says at once when the PC cannot reach it.

Every step has its own error handling: a step that fails says why and stops, rather than leaving the data source half done. Run it as often as needed — to test the connection again, after a change on the server, or with a new password: each run only updates SMARTBI and checks it again.

Run it from an editor

Pasted into a new tab of PowerShell ISE, Visual Studio Code or another editor, the script runs whatever the PC's script policy, and the tab shows the whole script with its comments before it runs. Started as administrator, it may create the system data source.

The script points SMARTBI at the SMART Migration server, by the name it reports for itself — the name the Settings tab shows — with port 5432 and the database SMARTBI. When the BI database runs on another server, change $Server at the top of the script before running it; until SMART Migration has reported its name, the script asks for it.

The SMART Migration installer sets up PostgreSQL with these defaults, and the script starts from them:

SettingDefault
Port5432
DatabaseSMARTBI
Userpostgres
Passwordadmin
Windows service, on the SMART Migration serverpostgresql-x64-18

After installation, PostgreSQL on the SMART Migration server accepts connections from that machine only. An administrator of that server lets the PCs in once — by hand, or with the optional script the dialog shows under Show the server script (optional). The dialog's Let other PCs in by hand opens the steps: see Let other PCs reach the BI database

The script puts the installer's PostgreSQL user and password, postgres and admin, into SMARTBI, as the installer does on the SMART Migration server. The first time a PC refreshes the report, Power BI Desktop asks how to sign in: choose Default or Custom, then Connect, and it signs in with the user in SMARTBI. See Open the report template

A changed password is changed in SMARTBI too

When the password of postgres is changed in PostgreSQL, change it in the SMARTBI data source as well — on the SMART Migration server and on every PC that has it, in ODBC Data Sources (64-bit) — or change it at the top of the script and run it again on each PC. Until then, the report cannot refresh there.

What you seeWhat to do
The script says to start PowerShell as administratorStart the editor or PowerShell with Run as administrator, and run the script again.
The script says the driver is not installedInstall the 64-bit driver (Download the PostgreSQL ODBC driver in the dialog), then run the script again.
The script says the PC cannot reach the serverLet the PCs in on the SMART Migration server: see Let other PCs reach the BI database. A VPN may be needed from outside the office.
Power BI says the data source name is not foundPower BI Desktop is 64-bit: the driver and SMARTBI must be 64-bit too. Run the setup again; ODBC Data Sources (64-bit) in Windows lists it.
Power BI asks for a user name and passwordClick the Default or Custom tab in its dialog, then Connect: see Open the report template
The first load of the data failsA limitation of Power BI: click Refresh on the Home tab, and the data loads.
Power BI says the password is wrongThe password was changed in PostgreSQL: change it in SMARTBI (ODBC Data Sources (64-bit)), or at the top of the script and run it again. Data source settings in Power BI Desktop clears a sign-in typed before.
The script asks for the server's nameSMART Migration has not reported its name yet: type the SMART Migration server's network name, or the PostgreSQL server's when the BI database runs elsewhere.

See also