Skip to content

Commit 8ccf830

Browse files
committed
Update team slicer article
AB#53177: Add a team slicer to a Power BI report
1 parent cd6984c commit 8ccf830

11 files changed

+42
-97
lines changed

docs/report/powerbi/includes/rename-query.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.date: 12/08/2022
88

99
## (Optional) Rename query
1010

11-
You can rename the default query label, *Query1* to something more meaningful by opening the menu for the query and selecting **Rename**.
11+
You can rename the default query label, *Query1*, to something more meaningful. Simply enter a new name from the **Query Settings** pane.
1212

1313
:::image type="content" source="../media/transform-data/rename-query.png" alt-text="Screenshot of Power BI query menu options, rename query. ":::
1414

Loading
Loading
Loading
1.55 KB
Binary file not shown.

docs/report/powerbi/sample-boards-cfd.md

+1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ The following table describes each part of the query.
9696
**Description**
9797
:::column-end:::
9898
:::row-end:::
99+
---
99100
:::row:::
100101
:::column span="1":::
101102
`$apply=filter(`

docs/report/powerbi/sample-boards-releaseburndown.md

+2-9
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ The queries in this section show how to generate burndown charts of work items b
3838

3939
### Burndown of User Stories in an area path from start and end date
4040

41-
4241
The following query shows you how to return historical data of User Stories for a release based on work items tagged with a release tag.
4342

4443
> [!NOTE]
@@ -415,13 +414,7 @@ Prior to creating the report, you'll need to expand columns that return records
415414
- `AssignedTo`
416415

417416
To learn how to expand work items, see [Transform Analytics data to generate Power BI reports](transform-analytics-data-report-generation.md#expand-columns).
418-
419-
## Power BI transforms
420-
421-
[!INCLUDE [temp](includes/sample-expandcolumns.md)]
422-
423-
[!INCLUDE [temp](includes/sample-finish-query.md)]
424-
417+
425418

426419
## Create the clustered column chart
427420

@@ -435,7 +428,7 @@ Power BI shows you the fields you can report on.
435428

436429
:::image type="content" source="media/reports-boards/release-burndown-visualizations.png" alt-text="Screenshot of Power BI Visualizations and Fields selections for Release burndown clustered column chart report. ":::
437430

438-
1. Add the `DateValue` to **X-Axis** and right-click `DateValue` and select `DateValue`, rather than `Date Hierarchy`
431+
1. Add `DateValue` to **X-Axis**, right-click and select `DateValue`, rather than `Date Hierarchy`
439432

440433
1. Add `Count` to **Y-Axis**.
441434

docs/report/powerbi/sample-boards-sprintburndown.md

+17-22
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ To learn more about burndown and burnup, and [Burndown and burnup guidance](../d
3131

3232
## Sample queries
3333

34+
Burndown charts require querying the `WorkItemSnapshot` entity set to get historical data.
35+
3436
[!INCLUDE [temp](includes/query-filters-work-items.md)]
3537

3638
### Burndown User Stories for an area path and the current iteration
@@ -264,8 +266,7 @@ https://analytics.dev.azure.com/{organization}/{project}/_odata/v3.0-preview/Wor
264266

265267
* * *
266268

267-
### Burndown User Stories for all sprints since the start of a year
268-
### All Sprints since the beginning of the year
269+
### Burndown User Stories for all sprints since the start of a year
269270

270271
You may want to view a burndown of all the sprints in a single report. These queries pulls in sprint burndowns, and their by story points, for all sprints since the beginning of year 2022.
271272

@@ -373,38 +374,32 @@ https://analytics.dev.azure.com/{organization}/{project}/_odata/v3.0-preview/Wor
373374
[!INCLUDE [temp](includes/rename-query.md)]
374375

375376

376-
## Power BI transforms
377-
378-
[!INCLUDE [temp](includes/sample-expandcolumns.md)]
377+
## Transform data in Power BI
379378

380-
[!INCLUDE [temp](includes/sample-finish-query.md)]
379+
Prior to creating the report, you'll need to expand columns that return records containing several fields. In this instance, you'll want to expand the following records:
380+
- `Area`
381+
- `Iteration`
382+
- `AssignedTo`
381383

384+
To learn how to expand work items, see [Transform Analytics data to generate Power BI reports](transform-analytics-data-report-generation.md#expand-columns).
385+
382386

383-
## Create the report
387+
## Create the stacked column chart report
384388

385-
1. In Power BI, choose the **Line chart** report under **Visualizations** and select the fields as shown in the following image.
389+
1. In Power BI, choose the **Stacked column chart** report under **Visualizations** and select the fields as shown in the following image.
386390

387391
:::image type="content" source="media/reports-boards/sprint-burndown-visualizations.png" alt-text="Screenshot of Power BI Visualizations and Fields selections for Sprint Burndown report. ":::
388-
389-
For a simple report, do the following steps:
390392

391-
1. Select Power BI Visualization **Clustered column chart**.
392-
1. Add the field "DateValue" to **Axis**
393-
- Right-click "DateValue" and select "DateValue", rather than Date Hierarchy
394-
1. Add the field "TotalStoryPoints" to **Values**
395-
1. Add the field "Count" to **Values**
393+
1. Add `DateValue` to **X-Axis**, right-click and select `DateValue`, rather than `Date Hierarchy`
396394

397-
The example report, which displays burndown on both Story Points and Count of Stories.
395+
1. Add `Count` to **Y-Axis**.
398396

397+
1. Add `State` to **Y-Axis**.
399398

400-
:::image type="content" source="media/reports-boards/sprint-burndown-clustered-column-chart.png" alt-text="Screenshot of Sample Power BI Sprint burndown clustered column chart report.":::
401-
402-
403-
399+
The example report, which displays burndown on both Story Points and Count of Stories.
404400

405-
## Full list of sample reports
406401

407-
[!INCLUDE [temp](includes/sample-fulllist.md)]
402+
:::image type="content" source="media/reports-boards/sprint-burndown-clustered-column-chart.png" alt-text="Screenshot of Sample Power BI Sprint burndown clustered column chart report.":::
408403

409404
## Related articles
410405

docs/report/powerbi/sample-boards-teamslicer.md

+16-61
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.author: kaelli
88
author: KathrynEE
99
ms.topic: sample
1010
monikerRange: '>= azure-devops-2019'
11-
ms.date: 10/05/2021
11+
ms.date: 12/08/2022
1212
---
1313

1414

@@ -30,7 +30,7 @@ Often Power BI reports include data from multiple teams for aggregation and comp
3030

3131
## Sample queries
3232

33-
You'll need to add another query to your Power BI report. The query below returns the mapping between Teams and Area Paths.
33+
To use a team slicer in a Power BI report, you'll need to add another query to your Power BI report. The query below returns the mapping between teams and Area Paths.
3434

3535
#### [Power BI query](#tab/powerbi/)
3636

@@ -83,6 +83,7 @@ The following table describes each part of the query.
8383
**Description**
8484
:::column-end:::
8585
:::row-end:::
86+
---
8687
:::row:::
8788
:::column span="1":::
8889
`$filter=startswith(AreaPath, '{areapath}')`
@@ -96,24 +97,23 @@ The following table describes each part of the query.
9697
`&$select=AreaSK, AreaPath`
9798
:::column-end:::
9899
:::column span="1":::
99-
Returning Area Path fields, to use for mapping
100+
Return Area Path fields, to use for mapping.
100101
:::column-end:::
101102
:::row-end:::
102103
:::row:::
103104
:::column span="1":::
104105
`&$expand=Teams($select=TeamName)`
105106
:::column-end:::
106107
:::column span="1":::
107-
Returning the Team associated with the Area Path
108+
Return the team associated with the Area Path.
108109
:::column-end:::
109110
:::row-end:::
110111

111112

112-
[!INCLUDE [temp](includes/query-filters-work-items.md)]
113-
114-
## Power BI transforms
115113

116-
### Expand the Teams column
114+
[!INCLUDE [temp](includes/rename-query.md)]
115+
116+
## Expand the Teams column
117117

118118
1. Choose the expand button.
119119

@@ -129,79 +129,34 @@ The following table describes each part of the query.
129129

130130
> [!div class="mx-imgBorder"]
131131
> ![Table will now contain entity field(s).](media/odatapowerbi-expandteam3.png)
132-
133-
[!INCLUDE [temp](includes/sample-finish-query.md)]
132+
134133

135134
## Create a Relationship using "AreaSK"
136135

137136
After selecting Close & Apply, and returning to Power BI, follow these steps:
138137

139-
1. Select **Modeling** menu
140-
1. Select **Manage Relationships**
138+
1. From the **Modeling** menus, select **Manage Relationships**.
141139
1. Create a relationship between your Report query and the Teams query. It's likely that Power BI will autodetect and create the relationship for you. Here's an example of a relationship between the query in the [Open Bugs](sample-boards-openbugs.md) report and the Teams query:
142140

143141
> [!div class="mx-imgBorder"]
144142
> ![Example of relationship between queries.](media/odatapowerbi-timeslicer-relationships.png)
145143
146144
## Add the Team Filter to an existing report
147145

148-
Power BI shows you the fields you can report on.
149-
150-
> [!NOTE]
151-
> The example below assumes that no one renamed any columns.
152-
153-
> [!div class="mx-imgBorder"]
154-
> ![The example assumes that no one renamed any columns.](media/odatapowerbi-timeslicer-fields.png)
146+
1. On the page you want to add the team filter to, make sure no charts are selected, and then choose **Slicer** from the **Visualizations** pane.
155147

156-
To add a team filter to the Power BI report, follow these steps:
148+
:::image type="content" source="media/reports-boards/team-slicer-visualizations.png" alt-text="Screenshot of Power BI Visualizations and Fields selections for team slicer. ":::
157149

158-
1. Select Visualization **Slicer**
159-
1. Add the "Team.TeamName" field to **Field**
150+
1. Add `Team.TeamName` to **Field**.
160151

152+
<!---
161153
The example below shows the [Open Bugs](sample-boards-openbugs.md) report with a Team filter added. Selecting a team in the slicer filters the results of the Open Bugs report. It will work for any report, as long as its query returns AreaSK.
162154
163155
> [!div class="mx-imgBorder"]
164156
> ![Team Slicer report](media/odatapowerbi-timeslicer-report.png)
165157
166-
## Additional queries
167-
168-
You can use the following additional queries to create different but similar reports. You can use these queries with the steps defined above.
169-
170-
### Filter by Teams, rather than Area Path
171-
172-
This query is the same as the one used above, except it filters by Team Name rather than Area Path.
173-
174-
#### [Power BI query](#tab/powerbi/)
175-
176-
[!INCLUDE [temp](includes/sample-powerbi-query.md)]
177-
178-
```
179-
let
180-
Source = OData.Feed ("https://analytics.dev.azure.com/{organization}/{project}/_odata/v1.0/Areas?"
181-
&"$filter=(Teams/any(x:x/TeamName eq '{teamname}) or Teams/any(x:x/TeamName eq '{teamname}) or Teams/any(x:x/TeamName eq '{teamname}) "
182-
&"&$select=AreaSK,AreaPath "
183-
&"&$expand=Teams($select=TeamName) "
184-
,null, [Implementation="2.0",OmitValues = ODataOmitValues.Nulls,ODataVersion = 4])
185-
in
186-
Source
187-
```
188-
189-
#### [OData query](#tab/odata/)
190-
191-
[!INCLUDE [temp](includes/sample-odata-query.md)]
192-
193-
```
194-
https://analytics.dev.azure.com/{organization}/{project}/_odata/v1.0/Areas?
195-
$filter=(Teams/any(x:x/TeamName eq '{teamname}) or Teams/any(x:x/TeamName eq '{teamname}) or Teams/any(x:x/TeamName eq '{teamname})
196-
&$select=AreaSK,AreaPath
197-
&$expand=Teams($select=TeamName)
198-
```
199-
200-
***
201-
202-
## Full list of sample reports
203-
204-
[!INCLUDE [temp](includes/sample-fulllist.md)]
158+
-->
159+
205160

206161
## Related articles
207162

docs/report/powerbi/toc.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ items:
8787
href: transform-analytics-data-report-generation.md
8888
- name: Create a Power BI report
8989
href: create-report.md
90+
- name: Add a team slicer to a report
91+
href: sample-boards-teamslicer.md
9092
- name: Sample reports, Boards
9193
items:
9294
- name: Open bugs
@@ -108,8 +110,6 @@ items:
108110
displayname: CFD
109111
- name: Lead/Cycle time
110112
href: sample-boards-leadcycletime.md
111-
- name: Add a team slicer
112-
href: sample-boards-teamslicer.md
113113
- name: Sample reports, Pipelines
114114
items:
115115
- name: Outcome summary

docs/report/powerbi/transform-analytics-data-report-generation.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ For easier reporting, replace nulls with zero by following these steps.
186186

187187
### Create a percentage complete computed column
188188

189+
Prior to adding the percentage complete column, make sure that you replace all null values in the pivoted state columns.
189190
1. Select **Add Column** menu.
190191
1. Select **Custom Column**.
191192
1. Enter **PercentComplete** for **New column name**.
@@ -197,8 +198,8 @@ For easier reporting, replace nulls with zero by following these steps.
197198
:::image type="content" source="media/reports-boards/custom-column-dialog-percent-complete.png" alt-text="Custom Column Dialog, PercentComplete syntax.":::
198199
199200
> [!NOTE]
200-
> It is possible you won't have a **Resolved** column, if the work items don't have States mapped to the Resolved State Category.
201-
> If so, then omit "[Resolved]" in the above formula.
201+
> It's possible that you won't have a **Resolved** column, if the work items don't have States mapped to the *Resolved* workflow state category.
202+
> If so, omit "[Resolved]" in the above formula.
202203
203204
1. Press **OK**.
204205
1. Select **Transform** menu.

0 commit comments

Comments
 (0)