Creating and Using Templates
Step 1: Create the Dashboard with URL Flow
- Create a new Power BI dashboard.
- Add the necessary visualizations and connect the dashboard to Autodesk Data Exchange using the provided URL flow
Step 2: Adjust Data in Transform Data
Once the dashboard is created, follow these steps to adjust the data in Transform Data:
Open the Home tab and select Transform data.
In the Power Query Editor, go to Advanced Editor and replace the existing query with the following code.
let
Source = AutodeskDataExchange.Contents("Data Exchange", #"URL", [selectedUnit=null, filter=null]), // Load data from the Autodesk Data Exchange connector
FirstRow = Table.First(Source), // Get the first row from the data source
DXTable = FirstRow[Data], // Extract the 'Data' field (a table) from the first row
ViewerColumn = List.First(List.Select(Table.ColumnNames(DXTable), each Text.EndsWith(_, ".viewer"))), // Find the column name that ends with '.viewer'
RenamedTable = Table.RenameColumns(DXTable, {{ViewerColumn, "Base Query.viewer"}}) // Rename the viewer column to 'Base Query.viewer'
in
RenamedTable // Return the extracted data table
From the Manage parameters menu, select New parameter and configure it as follows:
- Name: URL or a name of your choice
- Description: Provide the model URL or customize as needed
- Type: Text
- Current value: Use the same URL used to create the dashboard
Click OK.
To make the template reusable, rename the table in the Queries pane:
- Right-click the table name, such as "3D Architectural".
- Select Rename, and enter a generic name such as Base Query.
Click Close & apply to save your changes and return to the main view.
Step 3: Save as Template
Navigate to File > Save As.
Select the desired folder for saving the template.
Enter a name for the file.
From the file type dropdown, select Power BI template (.pbit).
Add a short description for the template and click OK.
Using Templates
Open the template and connect your data
Open the Power BI template. A dialog box will appear.
In the dialog box, enter the URL of the Revit Data Exchange from Autodesk Construction Cloud.
Understanding why your Power BI table name might differ
The Power BI template uses a fixed table name: Base Query. This setup is required for the following reasons:
- The table is loaded using a blank query.
- Power BI does not support dynamic renaming of queries during runtime.
When you connect to a model using the Autodesk connector, Power BI automatically names the table based on the model name from Autodesk Construction Cloud. This creates a mismatch between the expected table name in the template and the actual name of the loaded table.
To avoid issues, rename the loaded table to match the expected name. For example, change the auto-generated model name to Base Query in the Queries pane.