Overview
Cosmos Power BI templates are built against the standard Cosmos data model. If you have renamed tables or fields in your Cosmos environment, the template will be unable to locate those items and will display errors on your visuals. This article walks you through how to correct mismatched table names and field names in Power BI's Power Query Editor so your visuals load correctly.
Understanding the Error
When a Power BI template cannot find a table or field, it displays an error such as "the key didn't match any rows in the table." This means Power BI is looking for a name—for example, Global Dimension 1—that no longer matches what the table or field is called in your Cosmos data model. You will need to update the table name reference and any affected field names in the Power Query Editor.
Fixing the Table Name
To open the Power Query Editor, you will click the Transform Data button in the Home ribbon. The Power Query Editor will open, displaying the list of tables connected to your report.
To locate the table with the error, you will find and select it in the left-hand query list—for example, Global Dimension 1. Power BI will display an error for that query, indicating it cannot find the table.
To correct the table name, you will click on the Navigation step in the Applied Steps pane. You will see the table name that Power BI is currently looking for. Replace that value with the exact name of the table as it exists in your Cosmos data model, then press Enter. If the table name contains spaces, use underscores in place of spaces—for example, Sales_Transactions. Power BI will attempt to load data from the updated table name.
Fixing Field Name Errors
After correcting the table name, you may still see errors if field names within that table have also been renamed. To navigate to the field error, you will click Go to Error when prompted. Power BI will highlight the step containing the mismatched field names.
To correct a field name, you will update the field name value to match the exact field name in your Cosmos data model—for example, changing a field to department_code or department_name as appropriate. Leave the caption value unchanged, as other calculations may depend on it. Press Enter when finished. Repeat this process for each field that shows an error.
Applying Your Changes
To save and apply all corrections, you will click Close & Apply in the Power Query Editor. Power BI will reload the data using the updated table and field names. Once the data finishes loading, your visuals will display correctly and the errors will be resolved.
Note: Only update the field name values that are causing errors. Avoid modifying captions or other query steps, as these may be referenced by calculated measures elsewhere in the template.
Comments
0 comments
Article is closed for comments.