Who can use this feature?
- Global admins or users with advanced permissions
- Available on all plans
Leverage Totango API endpoints to retrieve segmented data directly from the Totango platform and bring that data into Microsoft Power BI.
Before you begin
These instructions assume the following:
- You have a windows machine with administrative privileges
- You have Power BI Desktop installed
1. Install Python
If you already have Python installed, you may skip this section.
- Download the latest version of Python: https://www.python.org/downloads/
The download links are at the bottom (look for windows installer); choose which system type you have (64 bit or 32 bit). If you don’t know, you can check by going to Start > Settings > System > About, and look under system type.
- Once downloaded, right click on the installer and click on run as administrator. If prompted verify by clicking Yes.
- Select the option to Add Python 3.10 to PATH.
- Click on Customize installation.
- Clear all checkboxes except pip and py launcher, and then click Next.
- Leave the Advanced Options as is, and then click Install.
- Once done click Close.
- Reboot your machine.
2. Install packages
If you already have any of these packages installed, you may skip this section.
- Open the Command Prompt (click on the magnifying glass at the bottom left to search, and type in cmd).
-
Type in the following within the Command Prompt:
pip install pandas
Press Enter and wait for it to complete.
pip install matplotlib
Press Enter and wait for it to complete.
pip install requests
Press Enter and wait for it to complete.
3. Import Totango data into PowerBI
This section requires you to modify a code snippet with the contents of an API endpoint and your Totango personal access token.
- Copy the code for PowerBI.py from the git repository into a text editor on your computer.
- Within Totango, create a segment of the data you want to pull.
- Modify filters to ensure only the accounts you want are in your data set.
- Edit columns to add columns to the data set.
- From within the segment, click the Ellipses button > Generate API Endpoint.
- Within the API Endpoint window, copy everything between 'query= and ' --header (just like in the image below).
Identifier data types and asc/desc clauses are not supported in the query string.
- Within your text editor with the code from github, paste what you just copied from Totango in place of {your_query}.
- Obtain your Totango token (Edit Profile > Integrations).
- Within your text editor, paste the token in place of <yourtokenhere>.
Be sure to leave the single quotes in place.
- Copy the entire code from the text editor.
- Within Power BI, go to Get Data > More...
- In the Get Data window, search for Python script. Select it, and click Connect.
- In the window paste the code, and click OK.
This may take some time for the data to finish. If there are any issues, please reach out to Totango Support and provide the error message, the code you pasted, your token, and your query.
If you get an error that references the following:
NameError: name 'true' is not defined
NameError: name 'false' is not defined
Do a search and replace within the code for all instances of true with True (notice upper case). Do the same for false.