Changing sources

Now that we have copies of our January query, we want to change the data sources for our January (2) and January (3) queries to instead load data for February and March, respectively. To do this, perform the following operations:

  1. Click on the January (2) query.
  2. In the Applied Steps area of the Query settings pane, click the gear icon next to the Navigation step.
  3. In the Navigation dialog, click February.
  4. Click the OK button.

Note that there is a yellow warning icon next to the January (2) query in the Queries pane. Also note that two additional steps have been added to our query, just below the Navigation step: Promoted Headers1 and Changed Type1. If we click on the Expanded Tasks step in our query, we will see that an error message has been displayed. To fix this, execute the following steps:

  1. Use the X icon to delete the Promoted Headers1 and Changed Type1 steps of our query.
  2. In the Delete Step dialog that is displayed, choose the Delete button each time. After deleting these steps, all warnings and errors will be removed.
  3. Finally, under the PROPERTIES section of the Query Settings pane, change the Name of the query from January (2) to February.

The preceding method is one way of changing the source for a query. But there is another way to change the source: by editing the underlying M code. To use this method, execute the following steps:

  1. Click on the January (3) query in the Queries pane.
  2. Click the Navigation step.
  1. This time, edit the formula bar and replace the word January with the word March so that the formula for this step appears as follows:
= Source{[Item="March",Kind="Sheet"]}[Data]
  1. Press the Enter key to complete the formula. This time, no additional steps were added to our query.
  2. Rename the query to March.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.68.206