在 Power BI Desktop 中使用數值範圍交叉分析篩選器Use the numeric range slicer in Power BI Desktop

透過 [數值範圍交叉分析篩選器],您可以將各式各樣的篩選器套用至資料模型中的任何數值資料行。With the numeric range slicer, you can apply all sorts of filters to any numeric column in your data model. 您可以選擇篩選兩個數字之間小於或等於某個數字,或是大於或等於某個數字。You can choose to filter between numbers, less than or equal to a number, or more than or equal to a number. 這聽起來或許很簡單,但卻是篩選資料的強大方式。While this may sound straightforward, it's a very powerful way to filter your data.

使用數值範圍交叉分析篩選器Using the numeric range slicer

您可以將數值範圍交叉分析篩選器當作任何其他交叉分析篩選器來使用。You can use the numeric range slicer just like any other slicer. 只要建立報表的 [交叉分析篩選器] 視覺效果,然後選取一個數值作為 [欄位] 值即可。Simply create a slicer visual for your report, and then select a numeric value for the Field value. 在下圖中,已選取 [UnitPrice] 欄位。In the following image, the UnitPrice field is selected.

選取 [數值範圍交叉分析篩選器] 右上角的插入號,即會出現一個功能表。Select the carat in the upper-right corner of the numeric range slicer and a menu appears.

針對數值範圍,您可以從下列三個選項中進行選取:For the numeric range, you can select from the following three selections:

  • 之間Between
  • 小於或等於Less than or equal to
  • 大於或等於Greater than or equal to

當您從功能表選取 [之間] 時,會出現一個滑桿,以供您篩選落於兩個數字之間的數值。When you select Between from the menu, a slider appears and you can filter for numeric values that fall between the numbers. 除了使用滑動軸本身,您還可以按一下任一方塊,然後輸入值。In addition to using the slider bar itself, you can click in either box and type in the values. 當您想要配量特定整數時,此方法十分方便,但移動滑動軸的精細度很難剛好落在該數字上。This is convenient when you want to slice on specific whole numbers, yet the granularity of moving the slicer bar makes it difficult to land exactly on that number.

在下圖中,會針對範圍介於 500 到 1500 之間的 [UnitPrice] 值篩選報表頁面。In the following image, the report page is filtered for UnitPrice values that range between 500 and 1500.

當我們選取 [小於或等於] 時,滑動軸的左控點 (下限值) 會消失,而我們只能調整滑動軸的上限。When we select Less than or equal to, the left (lower value) handle of the slider bar disappears, and we can adjust only the upper bound of the slider bar. 在下圖中,我們會將滑動軸設定為 497.17。In the following image, we set the slider bar to 497.17.

最後,如果我們選取 [大於或等於],則滑動軸的右控點 (上限值) 會消失,而我們可以調整下限值,如下圖所示。Lastly, if we select Greater than or equal to, then the right (highest value) slider bar handle disappears, and we can adjust the lower value, as seen in the following image. 現在,只有 [UnitPrice] 大於或等於 750.56 的項目會顯示在報表頁面的視覺效果中。Now only items with a UnitPrice greater than or equal to 750.56 are displayed in the visuals on the report page.

限制與考量Limitations and considerations

[數值範圍交叉分析篩選器] 目前適用下列限制與考量The following limitations and considerations currently apply to the numeric range slicer

  • [數值範圍交叉分析篩選器] 目前會篩選資料中的每個基礎資料列,而不是任何彙總值。The numeric range slicer currently filters every underlying row in the data, not any aggregated value. 例如,如果使用 [Sales Amount] 欄位,則會根據 [Sales Amount] 篩選每筆交易,而不是根據視覺效果之每個資料點的 [Sales Amount] 總和。For example, if a Sales Amount field is used, each transaction based on Sales Amount would be filtered upon, not the sum of Sales Amount for each data point of a visual.
  • 目前無法搭配量值使用It does not currently work with Measures
  • 目前只能在 Power BI Desktop 中使用 [數值範圍交叉分析篩選器]。Currently the numeric range slicer is only available in Power BI Desktop. 如果將使用 [數值範圍交叉分析篩選器] 的報表發佈至 Power BI 服務,還是會套用此篩選器,但會顯示為清單交叉分析篩選器。If a report that uses the numeric range slicer is published to the Power BI service, the filter will still be applied but it will appear as a list slicer.