在 Power BI Desktop 中使用群組和量化Use grouping and binning in Power BI Desktop

Power BI Desktop 建立視覺效果時,會根據在基礎資料中找到的值,將資料彙總成區塊 (或群組)。When Power BI Desktop creates visuals, it aggregates your data into chunks (or groups) based on values found in the underlying data. 通常沒有問題,但您偶爾會想要調整這些區塊的呈現方式。Often that's fine, but there may be times when you want to refine how those chunks are presented. 例如,您可能想要將三種產品類別放在一個較大的類別 (一個「群組」) 中。For example, you might want to place three categories of products in one larger category (one group). 或者您可能想要以量化大小 1,000,000 美元來查看銷售數字,而不是等分為 923,983 美元。Or you might want to see sales figures put into bin-sizes of 1,000,000 dollars, instead of evenly-divided 923,983 dollars.

在 Power BI Desktop 中,您可以群組資料點,以協助您更清楚地檢視、分析及探索視覺效果中的資料和趨勢。In Power BI Desktop, you can group data points to help you more clearly view, analyze, and explore data and trends in your visuals. 您也可以定義量化大小 (通常稱為量化),將值放入大小相同的群組,好讓您以有意義的方式將資料視覺化。You can also define the bin size, often called binning, to put values into equally sized groups that better enable you to visualized data in ways that are meaningful.

使用群組Using grouping

若要使用群組,請按住 Ctrl 鍵再按一下滑鼠來複選項目,以選取視覺效果上的兩個或多個項目。To use grouping, select two or more elements on a visual by using CTRL+CLICK to multi-select elements. 然後以滑鼠右鍵按一下其中一個複選項目,再從出現的功能表中選取 [群組]。Then right-click one of the multi-select elements, and select Group from the menu that appears.

建立後,群組會加入視覺效果的 [圖例] 貯體,並同時出現在 [欄位] 清單中。Once created, the group is added to the Legend bucket for the visual, and also appears in the Fields list.

一旦您有一個群組,即可輕鬆地編輯該群組的成員,方法是以滑鼠右鍵按一下 [圖例] 貯體或 [欄位] 清單中的欄位,然後選取 [編輯群組]。Once you have a group, you can easily edit the members of that group by right-clicking the field from the Legend bucket or from the Fields list, and selecting Edit Groups.

在出現的 [群組] 視窗中,您可以建立新的群組或修改現有的群組。In the Groups window that appears you can create new groups, or modify existing groups. 您也可以「重新命名」任何群組,方法是按兩下 [群組和成員] 方塊中的 [群組] 標題,然後鍵入新名稱。You can also rename any group by double-clicking on the Group title in the Groups and members box, and typing a new name.

您可以使用此視窗中的群組執行各種作業。There are all sorts of things you can do with groups in this window. 您可以將 [未分組的值] 清單的項目新增到新的群組,或新增到其中一個現有群組。You can add items from the Ungrouped values list into a new group, or into one of the existing groups. 若要建立新的群組,請從 [未分組的值] 方塊選取兩個或更多個項目 (使用 CTRL + 按一下),然後按一下該方塊下方的 [群組] 按鈕。To create a new group, select two or more items (using CTRL+click) from the Ungrouped values box and then click the Group button below that box.

您可以將未分組的值新增至現有的群組︰只要選取 [未分組的值],然後選取要新增的目標現有群組,再按一下 [群組] 按鈕。You can add an ungrouped value into an existing group: just select the Ungrouped value, then select the existing group to which you want to add it, and click the Group button. 若要從群組移除項目,請從 [群組及成員] 方塊加以選取,然後按一下 [取消群組]。To remove an item from a group, select it from the Groups and members box and then click Ungroup. 您也可以選擇未分組的類別是要放入 [其他] 群組中,還是要維持未分組。You can also select whether ungrouped categories should be placed into the Other group, or should remain ungrouped.

注意

您可以在 [欄位] 中建立任何欄位的群組,而不需要從現有的視覺效果中進行複選。You can create groups for any field in the Fields well, without having to multi-select from an existing visual. 只要以滑鼠右鍵按一下欄位,然後從出現的功能表中選取 [群組] 即可。Just right-click the field, and select Group from the menu that appears.

使用量化Using binning

您可以在 Power BI Desktop 中,設定數值和時間欄位的量化大小。You can set the bin size for numerical and time fields in Power BI Desktop. 您可以使用量化,將 Power BI Desktop 顯示的資料設定為正確大小。You can use binning to right-size the data that Power BI Desktop displays.

若要套用量化大小,請以滑鼠右鍵按一下 [欄位],然後選取 [群組]。To apply a bin size, right-click a Field and select Groups.

從 [群組] 視窗,將 [量化大小] 設定為您要的大小。From the Groups window, set the Bin size to the size you want.

當您選取 [確定] 時,您會注意到 [欄位] 窗格中會顯示新欄位,並在名稱後面加上 (二進位)When you select OK, you'll notice that a new field appears in the Fields pane with (bins) appended. 然後,您可以將該欄位拖曳到畫布上,以在視覺效果中使用量化大小。You can then drag that field onto the canvas to use the bin size in a visual.

若要查看量化的執行方式,請觀賞這段影片To see binning in action, take a look at this video.

使用群組量化可確保報表中的視覺效果只以您要的方式來顯示資料。And that's all there is to using grouping and binning to ensure the visuals in your reports show your data just the way you want them to.