How to use multiple Power BI Desktop profiles

Those who work in several Power BI tenants surely know the problem. For each tenant, you have to sign out and sign in again in the Power BI Desktop. If the same connectors, such as the Business Central connector, are used, the logon data must also be changed each time. How cool would it be if you could start Power BI Desktop with different profiles, which brings me to my little batch script idea.

Disclaimer
Please know, that everything I have created and shared on the blogpost is based on best effort. No rights can be derived, as well as I am not liable for the use or misuse of the solution or possible damage resulting from this. Use of the solutions and execution of the scripts is all on your own risk and your own responsibility.

With some research I found out that Power BI Desktop settings and credentials are stored in the %LOCALAPPDATA%\Microsoft\Power BI Desktop directory of the logged in user. So why not adjust the paths in the environment variables via batch script shortly before program start to load another profile?

The whole thing is just a proof of concept, I don’t know about the side effects.

Below is the small batch script I created for this purpose.

profile.bat

@echo off
setlocal
  rem Set your Power BI profile Name here
  set "USERNAME=ProfileName"

  rem Profile paths are adjusted.
  set "USERPROFILE=C:\PBIProfile\%USERNAME%"
  set "LOCALAPPDATA=%USERPROFILE%\AppData\Local"
  set "APPDATA=%USERPROFILE%\AppData\Roaming"
  set "TEMP=%LOCALAPPDATA%\Temp"
  set "TMP=%TEMP%"

  rem Creating directory for Edge Web View data
  if not exist "%LOCALAPPDATA%\Microsoft" mkdir "%LOCALAPPDATA%\Microsoft"
  if not exist "%LOCALAPPDATA%\Microsoft\" mkdir "%LOCALAPPDATA%\Microsoft\EdgeWebView"
  rem Creating desktop directory for save as dialog
  if not exist "%USERPROFILE%\Desktop" mkdir "%USERPROFILE%\Desktop"

  rem Start Power BI Desktop
  "C:\Program Files\Microsoft Power BI Desktop\bin\PBIDesktop.exe"
endlocal
rem timeout /T 10

In code line 4 you can set a unique profile name for each batch script.
Use possible simply profile names, because the name is used as directory name.
The profiles are stored in the directory „C:\PBIProfile\“, you can change this in code line 10 if necessary.

Veröffentlicht von

Marcus Wegener

Marcus Wegener

Marcus Wegener ist Full Stack Power BI & Fabric Engineer und schreibt auf thinkBI über Datenmodellierung, Power BI, Fabric und Business Intelligence als Grundlage besserer Entscheidungen. Im Zentrum steht nicht das Dashboard, sondern die Frage, wie aus fachlichen Anforderungen tragfähige Informationsstrukturen entstehen.

Ein Kommentar zu „How to use multiple Power BI Desktop profiles“

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

I accept that my given data and my IP address is sent to a server in the USA only for the purpose of spam prevention through the Akismet program.More information on Akismet and GDPR.