# Using the Power BI template: A step-by-step guide

Use the following steps to easily leverage our template and create your own dashboards.

{% hint style="info" %}
[Click here to download the template](https://drive.google.com/drive/folders/1zmf65I0Mci09Jgv7I5MwKbiizZvS1itm?usp=share_link). You will need to update to at least the July 2021 version of Power BI to open the template. If you have an older version, contact your IT to install the latest version of Power BI.
{% endhint %}

## Step 1: Set up

{% embed url="<https://youtu.be/G5RnlAY-rM4>" %}

* For this illustration, we create a chart of film locations over time
  * Dataset: <https://data.sfgov.org/Culture-and-Recreation/Film-Locations-in-San-Francisco/yitu-d5am>
* [Download the template](https://drive.google.com/drive/folders/1zmf65I0Mci09Jgv7I5MwKbiizZvS1itm)
* Save template with new file name, so you can refer back to original template
* [Import data and connect to date table](https://sfdigitalservices.gitbook.io/data-visualization-guide/data-management#your-underlying-data-should-be-publicly-available-preferably-on-the-open-data-portal)
  * Assume that all of the underlying data in a public Power BI dashboard is completely accessible to the public. Before making a public dashboard, [you'll need to consider data security.](https://docs.google.com/document/d/1XiyC4dCkMcjI74VToNtTLcCyc8FOtAcw_EfG7Df6nPc/edit#heading=h.w5g6g1fnlv1q)
  * After import, you may need to convert your date/time field to date format
* Identify the format you want to use
* Drop pages you will not be using

## Step 2: Visualize data

{% embed url="<https://youtu.be/09acfuijIa4>" %}

* Replace values in chart(s)
* Replace values in table(s)
  * Remember: you must have a table of data, and preferably a text equivalent of the data viz
* Update [titles](https://sfdigitalservices.gitbook.io/data-visualization-guide/accessibility/formatting-data-visualizations#create-meaningful-chart-and-axis-titles)
* Turn off [interactions](https://sfdigitalservices.gitbook.io/data-visualization-guide/accessibility/formatting-data-visualizations#turn-off-all-unnecessary-interactions)
* Review [formatting guidance](https://sfdigitalservices.gitbook.io/data-visualization-guide/accessibility/formatting-data-visualizations)

## Step 3: Accessibility updates

{% embed url="<https://youtu.be/iSl5YcoO69A>" %}

* Update all [alt text](https://sfdigitalservices.gitbook.io/data-visualization-guide/accessibility/alt-text)
  * Use example language in the template
* Verify [tab order](https://sfdigitalservices.gitbook.io/data-visualization-guide/accessibility/some-basics-1#curate-the-tab-order-to-provide-intentional-experience-for-screen-readers)

## Step 4: Mobile view

{% embed url="<https://youtu.be/P7avUbWHzQg>" %}

* Duplicate tab
* Resize visuals and re-size page
* Order visuals in tab order, confirm filters appear before the visuals that they filter
* [Mobile formatting updates](https://sfdigitalservices.gitbook.io/data-visualization-guide/mobile-view)
  * Shorter table
  * If you are using toggles, reformat to show all data without toggles on mobile view

## Step 5: Clean up and check your work

{% embed url="<https://youtu.be/k-1B77t6aEI>" %}

* Remove spacers
* Delete all mock data tables, apply changes, and verify nothing is broken.
* Name tabs desktop and mobile
* Complete developer checklist
  * Verify Alt text (click every visual/textbox -> format -> expand general -> inspect alt text)
  * Verify tab order is correct (click outside dashboard and use tab key)
* Publish to Power BI Online
* Use screen reader to verify alt text
* Publish to web
  * If you do not have the publish to web permissions, read [DataSF's Power BI Publish to Web Tip Sheet](https://docs.google.com/document/d/1XiyC4dCkMcjI74VToNtTLcCyc8FOtAcw_EfG7Df6nPc/edit?usp=sharing) and then contact your IT and supervisor for permissions.

## Converting a pre-existing file to the template

If you have a pre-existing Power BI dashboard you'd like to convert to this template, you have options. You can build within the template. In that case, you will just have to re-create your data model within this file. The easiest way to do this is to copy and paste each query code from the advanced editor and recreate your measures. Then just follow the same steps above.

If your pre-existing file is very complex, you can convert a file to this template using the steps below.

* Open pre-existing dashboard
* [Apply template JSON](https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-report-themes) style ([the json file in this folder](https://drive.google.com/drive/folders/1zmf65I0Mci09Jgv7I5MwKbiizZvS1itm?usp=sharing))
* Add new tab
* Re-size new blank page to width = 700, height = 800
* Copy/paste visuals from template file. Or, add new visuals
  * DO NOT copy or use any of the pre-existing visuals
* Complete all design and accessibility steps above
* Complete checklist
