Skip to content

Commit b30b298

Browse files
authored
Merge pull request #287978 from stevemunk/PowerBI-Data-Bound-Reference-Layer-and-Conditional-Formatting
Power bi data bound reference layer and conditional formatting
2 parents 646b248 + 197c28a commit b30b298

File tree

6 files changed

+136
-0
lines changed

6 files changed

+136
-0
lines changed
31.1 KB
Loading
448 KB
Loading
Loading
369 KB
Loading
54.3 KB
Loading

articles/azure-maps/power-bi-visual-understanding-layers.md

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,142 @@ The general layer section of the **Format** pane are common settings that apply
100100
>
101101
> For more information on the range scaling option, see **Range scaling** in the properties table of the [Add a bubble layer] article.
102102
103+
## Data-Bound Reference Layer
104+
105+
The Data-Bound Reference Layer enables the association of data with specific shapes in the reference layer based on common attributes.
106+
107+
To use the Data-Bound Reference layer, drag the column containing unique identifiers (can be location data or not) to the Location field of the Azure Maps Visual.
108+
109+
:::image type="content" source="media/power-bi-visual/data-bound-reference-layer/location-field.png" alt-text="A screenshot showing the location field in Power BI desktop.":::
110+
111+
Azure Maps matches these identifiers with the corresponding properties in the uploaded spatial file, automatically linking your data to the shapes on the map.
112+
113+
In scenarios with multiple properties, Azure Maps identifies a common property in each shape and compares its value with the selected data column in the Location field. It then uses the property that has the highest number of matches with the selected data column.
114+
115+
:::image type="content" source="media/power-bi-visual/data-bound-reference-layer/data-bound-reference-layer.png" lightbox="media/power-bi-visual/data-bound-reference-layer/data-bound-reference-layer.png" alt-text="A screenshot showing the Data-Bound Reference Layer example in Power BI desktop.":::
116+
117+
If one or more shapes in the reference layer can't be automatically mapped to any data point, you can manage these unmapped objects by following these steps:
118+
119+
1. Select the **Format visual** tab in the **Visualizations** pane.
120+
1. Select **Reference layer**.
121+
1. Select **Unmapped Objects**.
122+
1. Select the **Show** toggle switch to toggle On/Off. This highlights shapes that aren't mapped to any data points.
123+
124+
Optionally, select the **Use custom colors** toggle switch to toggle On/Off custom fill and border colors for unmapped objects to make them visually distinct on the map.
125+
126+
:::image type="content" source="media/power-bi-visual/data-bound-reference-layer/data-bound-reference-layer-unmapped-objects.png" lightbox="media/power-bi-visual/data-bound-reference-layer/data-bound-reference-layer-unmapped-objects.png" alt-text="A screenshot showing the Data-Bound Reference Layer example in Power BI desktop with unmapped objects showing in a different color.":::
127+
128+
<!----------------------------------------------------------------------------
129+
### Key matching example
130+
131+
#### Semantic model
132+
133+
| Datapoint | Country | City | Office name |
134+
|-------------|---------|----------|-------------|
135+
| Datapoint_1 | US | New York | Office C |
136+
| Datapoint_1 | US | Seattle | Office A |
137+
| Datapoint_1 | US | LA | Office B |
138+
139+
#### Reference layer data (take GeoJSON as an example)
140+
141+
```json
142+
{
143+
"type": "FeatureCollection",
144+
"features": [
145+
{
146+
"type": "Feature",
147+
"properties": {
148+
"name": "Office A",
149+
"shape": "Shape_1",
150+
"id": "Office A"
151+
},
152+
"geometry": {
153+
"type": "Polygon",
154+
"coordinates": [
155+
...
156+
}
157+
},
158+
{
159+
"type": "Feature",
160+
"properties": {
161+
"name": "Office B",
162+
"shape": "Shape_2",
163+
"id": "Office B"
164+
},
165+
"geometry": {
166+
"type": "Point",
167+
"coordinates": [
168+
...
169+
]
170+
}
171+
},
172+
{
173+
"type": "Feature",
174+
"properties": {
175+
"name": "Office C",
176+
"shape": "Shape_3"
177+
},
178+
"geometry": {
179+
"type": "Point",
180+
"coordinates": [
181+
...
182+
]
183+
}
184+
},
185+
{
186+
"type": "Feature",
187+
"properties": {
188+
"name": "Office D",
189+
"shape": "Shape_4"
190+
},
191+
"geometry": {
192+
"type": "Polygon",
193+
"coordinates": [
194+
...
195+
]
196+
}
197+
}
198+
]
199+
}
200+
```
201+
202+
#### the mapping results
203+
204+
| | Location bucket|Mapping result |
205+
|-----------------|----------------|--------------------------------------------------------------------------------|
206+
| Case 1 | Office name | Shape_1 ↔ Datapoint_2 |
207+
| | | Shape_2 ↔ Datapoint_3 |
208+
| | | Shape_3 ↔ Datapoint_1 |
209+
| | | Shape_4 ↔ x (Since there’s no datapoint with Office name “Office D”) |
210+
| Case 2 | City | Nothing is mapped, since there’s no property that contains matched City names. |
211+
212+
Note that there is a property “id” also has “Office x” values that is not being used, but instead the property “name” is used for data mapping since it has 3 datapoints matched and “id” only has 2 datapoints matched.
213+
214+
---------------------------------------------------------------------------------------------------------------------------->
215+
216+
## Conditional Formatting
217+
218+
Conditional formatting can be applied to data to dynamically change the appearance of shapes on a map based on the provided data. For instance, gradient colors can visualize various data values such as population density, sales performance, or other metrics. This is a powerful tool for combining spatial and business data to create interactive and visually compelling reports.
219+
220+
:::image type="content" source="media/power-bi-visual/data-bound-reference-layer/conditional-formatting.png" alt-text="A screenshot showing the Conditional Formatting controls for points, lines, polygons, and unmanaged objects in the reference layer control in Power BI desktop.":::
221+
222+
There are several ways to set colors to the shapes. The following table shows the priorities used:
223+
224+
| Priority | Source | Description |
225+
|----------|-------------------------------|-----------------------------------------------------------------|
226+
| 1 | Preset style in spatial files | Color and style as defined in the spatial file |
227+
| 2 | Unmapped object colors | Custom colors used when the geometry isn’t data-bound |
228+
| 3 | Legend colors | Colors provided by Legend/Series |
229+
| 4 | Conditional formatting colors | Colors provided by conditional formatting |
230+
| 5 | Custom formatting colors | User defined custom styles in the Reference Layer options in the formatting pane |
231+
| 6 | Default colors | Default colors defined in the Azure Maps visual |
232+
233+
> [!TIP]
234+
>
235+
> The Azure Maps Power BI Visual can only perform geocoding on valid location data such as geographical coordinates, addresses, or place names. If no valid location data is uploaded, data layers that depend on geocoded locations, such as heat maps or bubble layers, won’t display on the map.
236+
>
237+
> The Data-Bound Reference Layer will appear on the map as long as the data column contains unique identifiers that match properties in the spatial file, but to ensure correct results, your data column must include valid geographic information.
238+
103239
## Next steps
104240

105241
Change how your data is displayed on the map:

0 commit comments

Comments
 (0)