- Access exercises (91)
- C# exercises (79)
- Excel exercises (278)
- Power Apps exercises (13)
- Power Automate exercises (18)
- Power BI exercises (139)
- Power Platform exercises ()
- Python exercises (28)
- Report Builder exercises (141)
- SQL exercises (198)
- SSAS exercises (51)
- SSIS exercises (46)
- SSRS exercises (99)
- VBA exercises (85)
- Visual Basic exercises (46)
POWER BI EXERCISES▼
POWER BI EXERCISES▼
- Basic reports (10)
- Data sources (2)
- Query editor (8)
- Filtering data (9)
- Drill-through (1)
- Charts (10)
- Matrices (1)
- Basic maps (6)
- Calculated columns (8)
- Roles and security (1)
- Drill-through and bookmarks (3)
- Report themes (2)
- Power BI mobile (1)
- Advanced tables (3)
- Conditional formatting (5)
- Analytics (2)
- Decomposition tree (1)
- Other visuals (1)
- Tooltips (2)
- Bookmarks (4)
- Quick measures (3)
- Dynamic display (1)
- Custom visuals (3)
- Advanced data sources (4)
- Basic parameters (1)
- Column transforms (2)
- Combining queries (2)
- Manipulation transforms (1)
- Normalising tables (2)
- Simple parameters (1)
- Dropdown parameters (1)
- Stored procedures (1)
- Dynamic connections (2)
- Custom functions (3)
- APIs (3)
- Power BI Templates (1)
Power BI | APIs exercise | Show crimes for a given month for your area
This exercise is provided to allow potential course delegates to choose the correct Wise Owl Microsoft training course, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.
You need a minimum screen resolution of about 700 pixels width to see our exercises. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.
The aim of this exercise is to show a chart of street crime by category and status for your latitude and longitude:
Crime data for Leicester Square in London for February 2022
At the time of writing the figures are only accurate for England, Wales and Northern Ireland, and are only available up to and including February 2022. You can get more information on the API at the link included in the text file in the above folder.
Start by getting data from the API whose URL is included in the text file in the above folder. Apply transforms to tidy up the data to get something like this:
The first few of 29 crimes at the time of writing (the data may be updated, so your list may look different).
Create four parameters as follows:
|Parameter||What it should hold|
|Latitude||The latitude of the location (set to 51.51081 as a default).|
|Longitude||The longitude of the location (set to -0.13067 as a default).|
|Year||The year of interest (set to 2022 as a default).|
|Month||The month of interest as a two-digit number (02 as a default).|
Although these are all numerical values, you'll find it much easier to plug them into the data source formula if you make them text parameters.
Change the source of your query so that it refers to these parameters, and check it still returns the same data.
You should now have 4 parameters and a query (it may be best to add the parameters one by one to the expression for the query Source, since it's easy to get the syntax wrong).
If you right-click on any point in Google Maps you can see the latitude and longitude. Use this fact to change the location for your search to where you live (or work):
There are far less crimes (it turns out) near our office than in Leicester Square in London!
Apply your changes and load the data into Power BI Desktop. You can now create a chart to illustrate your data:
Theft crimes with no suspect dominated for this month and location, it seems.
Save your report as Taking the you-know-what, and close it down.