Power BI 中的瀑布图Waterfall charts in Power BI

备注

可以在 Power BI Desktop 和 Power BI 服务中创建并查看这些视觉对象。These visuals can be created and viewed in both Power BI Desktop and the Power BI service. 本文中的步骤和图示来自 Power BI Desktop。The steps and illustrations in this article are from Power BI Desktop.

瀑布图显示随 Power BI 加上或减去值而不断变化的总计。Waterfall charts show a running total as Power BI adds and subtracts values. 此类图可用于了解一系列正更改和负更改如何影响初始值(如净收入)。They're useful for understanding how an initial value (like net income) is affected by a series of positive and negative changes.

柱形使用颜色编码,这样就可以快速区分增加和减少。The columns are color coded so you can quickly notice increases and decreases. 初始值列和最终值列通常从水平轴开始,而中间值为浮动列。The initial and the final value columns often start on the horizontal axis, while the intermediate values are floating columns. 由于这种样式,瀑布图亦称为“桥图”。Because of this style, waterfall charts are also called bridge charts.

备注

此视频使用较旧版本的 Power BI Desktop。This video uses an older version of Power BI Desktop.

何时使用瀑布图When to use a waterfall chart

瀑布图适用情况:Waterfall charts are a great choice:

  • 若要跨时间、序列或不同类别更改度量值。When you have changes for the measure across time, a series, or different categories.

  • 若要审核对总计值有贡献的主要更改。To audit the major changes contributing to the total value.

  • 若要通过显示各种收入来源来绘制公司的年利润图,并计算出总利润(或损失)。To plot your company's annual profit by showing various sources of revenue and arrive at the total profit (or loss).

  • 若要说明一年中公司的起始和结束员工数。To illustrate the beginning and the ending headcount for your company in a year.

  • 若要直观呈现每月收入和支出,以及帐户不断变化的余额。To visualize how much money you make and spend each month, and the running balance for your account.

先决条件Prerequisite

本教程使用零售分析示例 PBIX 文件This tutorial uses the Retail Analysis sample PBIX file.

  1. 在菜单栏的左上方,选择“文件” > “打开”From the upper left section of the menubar, select File > Open

  2. 查找零售分析示例 PBIX 文件的副本Find your copy of the Retail Analysis sample PBIX file

  3. 在报表视图中打开零售分析示例 PBIX 文件 报表视图屏幕截图图标Open the Retail Analysis sample PBIX file in report view Screenshot of the report view icon..

  4. 选择Select 黄色选项卡的屏幕截图。 ,以添加新报表页。to add a new page.

创建瀑布图Create a waterfall chart

你将创建按月显示销售额差异(估计销售额与实际销售额)的瀑布图。You'll create a waterfall chart that displays sales variance (estimated sales versus actual sales) by month.

生成瀑布图Build the waterfall chart

  1. 在“字段”窗格中,依次选择“销售额” > “总销售额差异”。From the Fields pane, select Sales > Total Sales Variance.

    选择了“销售额”>“总销售额差异”并生成视觉对象的屏幕截图。

  2. 选择“瀑布图”图标Select the waterfall icon “瀑布图”图标的屏幕截图

    可视化效果模板

  3. 依次选择“时间” > “会计月份”,以将它添加到“类别”井中。Select Time > FiscalMonth to add it to the Category well.

    瀑布图

对瀑布图进行排序Sort the waterfall chart

  1. 请确保 Power BI 按时间顺序(月份)对瀑布图进行排序。Make sure Power BI sorts the waterfall chart chronologically by month. 选择图表右上角的“更多选项”(…)。From the top-right corner of the chart, select More options (...).

    对于本示例,请选择“排序依据”并选择“FiscalMonth”。For this example, select Sort by and choose FiscalMonth. 选择项旁边的黄色指示器指示应用选择选项的时间。A yellow indicator next to your selection indicates when your selection option is being applied.

    依次选择“排序依据”>“会计月份”

    若要按时间顺序显示月份,请选择“升序排序”。To display the months in chronological order, select Sort ascending. 与上一步一样,检查“升序排序”的左侧是否有黄色指示器。As with the previous step, check that there is a yellow indicator next to the left of Sort ascending. 这表示正在应用选定的选项。This indicates that your selected option is being applied.

    选择“排序方式”>“升序”

    请注意,对于 FiscalMonth,你的图表将按一月至八月排序。Notice that your chart is sorted from January to August for FiscalMonth.

浏览瀑布图Explore the waterfall chart

进一步了解每月发生变化的最主要原因。Dig in a little more to see what's contributing most to the changes month to month.

  1. 选择“商店” > “区域”,这会将“区域”添加到“细分”存储桶中。Select Store > Territory, which will add Territory to the Breakdown bucket.

    显示明细存储桶中的存储

    Power BI 使用“细分”中的值将其他数据添加到可视化效果中。Power BI uses the value in Breakdown to add additional data to the visualization. Power BI 按月将前五个影响因素添加到每个会计月的增减变化中。It adds the top five contributors to increases or decreases for each fiscal month. 例如,这意味着二月份有六个数据点,而不是只有一个。This means that February, for example, now has six data points instead of just one.

    显示明细存储桶中的存储

    假设你只关注前两个影响因素。Let's say that you're only interested in the top two contributors.

  2. 在“格式”窗格中,选择“细目”,并将“最大细目数”设置为“2”。In the Format pane, select Breakdown and set Max breakdowns to 2.

    “格式”>“细目”

    快速审阅发现,在瀑布图中,俄亥俄州和宾夕法尼亚州是正负变化的最大两个影响因素。A quick review reveals that the territories of Ohio and Pennsylvania are the biggest contributors to movement, both negative and positive, in your waterfall chart.

    瀑布图

后续步骤Next steps