Microsoft Power BI Complete Reference
上QQ阅读APP看书,第一时间看更新

Fill Down

Fill Down is a rather unique transform in how it operates. By selecting Fill Down on a particular column, a value will replace all Null values below it until another non-null appears. When another non-null value is present, that value will then fill down to all Null values. To examine this transform, you will pick up from where you left off with the Conditional Column example in the previous section.

  1. Right-click on the State Name column header and select Transform || Capitalize Each Word. This transform should be self-explanatory.
  2. Next, select the State Name column and, in the Transform ribbon, select Fill || Down. This will take the value in the State Name column and replace all non-null values until there is another State Name value that it can switch to. After performing this transform, scroll through the results to ensure that the value of Alabama switches to Alaska when appropriate.
  1. To finish this example, filter out any Null values that appear in the State Abbreviation column. The final result should look like this:

In this example, you learned how you can use Fill Down to replace all of the null values below a non-null value. You can also use Fill Up to do the opposite, which would replace all the null values above a non-null value.