Upgrade Guide to v1.2.133
In this guide, we cover how to upgrade your customized the Power BI report for compatibility with VIM Enterprise v1.2.133. This will allow your report to read the VIM SQL schema v5.4.0.b.
-
Download, extract, and install both VIM-Setup-v1.2.133.exe and VIM-Enterprise-Setup-v1.2.133.exe from the VIM Enterprise Installer Package
-
Open VIM Enterprise
-
(if connected to ACC) Update your ACC app bundles.
-
Re-run your projects. This process will automatically migrate your VIM SQL databases to the latest schema version (v5.4.0.b)
-
-
Copy your previously customized Power BI report to create a backup.
-
Open your previously customized Power BI report in Power BI Desktop:
-
Click on Transform Data
-
Select the "Element" table and click on "Advanced Editor". Modify the source to read from the SQL view "vw_Element_v3".
-
Rename the "Geometry-Node" table to "Element-Geometry"
-
Select the "Element-Geometry" table and click on "Advanced Editor". Replace the implementation with the following Power Query code (replacing the relevant values of "YOUR_DATABASE_SERVER" and "YOUR_DATABASE_NAME" for your own database), then click on "Done".
let
Source = Sql.Database("YOUR_DATABASE_SERVER", "YOUR_DATABASE_NAME"),
dbo_ElementGeometry = Source{[Schema="dbo",Item="ElementGeometry"]}[Data]
in
dbo_ElementGeometry -
Rename the "Instance-Geometry" table to "Element-Hierarchy"
-
Select the "Element-Hierarchy" table and click on "Advanced Editor". Replace the implementation with the following Power Query code (replacing the relevant values of "YOUR_DATABASE_SERVER" and "YOUR_DATABASE_NAME" for your own database), then click on "Done".
let
Source = Sql.Database("[YOUR_DATABASE_SERVER]", "[YOUR_DATABASE_NAME]"),
dbo_ElementHierarchy = Source{[Schema="dbo",Item="ElementHierarchy"]}[Data],
#"Merged Queries1" = Table.NestedJoin(dbo_ElementHierarchy, {"Descendant"}, Element, {"_key"}, "Element.1", JoinKind.LeftOuter),
#"Expanded Element.1" = Table.ExpandTableColumn(#"Merged Queries1", "Element.1", {"BimDocument_key"}, {"BimDocument_key"}),
#"Merged Queries2" = Table.NestedJoin(#"Expanded Element.1", {"BimDocument_key"}, BimDocument, {"_key"}, "Bim Document", JoinKind.LeftOuter),
#"Expanded Bim Document" = Table.ExpandTableColumn(#"Merged Queries2", "Bim Document", {"VIM"}, {"VIM"}),
#"Expanded VIM" = Table.ExpandRecordColumn(#"Expanded Bim Document", "VIM", {"FileName", "Url", "AccessToken"}, {"FileName", "Url", "AccessToken"}),
#"Renamed Columns" = Table.RenameColumns(#"Expanded VIM",{{"FileName", "FilePath"}}),
#"Added Custom" = Table.AddColumn(#"Renamed Columns", "Self", each if [Element] = [Descendant] then true else false),
#"Changed Type" = Table.TransformColumnTypes(#"Added Custom",{{"Self", type logical}}),
#"Added Custom1" = Table.AddColumn(#"Changed Type", "DescendantCount", each if [Self] = false then [Descendant] else null),
#"Renamed Columns1" = Table.RenameColumns(#"Added Custom1",{{"DescendantGeometryIndex", "Geometry.Index"}, {"DescendantNodeIndex", "Node.Index"}}),
#"Reordered Columns" = Table.ReorderColumns(#"Renamed Columns1",{"Element", "Descendant", "Distance", "_key", "DescendantNode", "Node.Index", "DescendantGeometry", "Geometry.Index", "Element(Descendant)", "Element(Element)", "Geometry", "Node", "BimDocument_key", "FilePath", "Url", "AccessToken", "Self", "DescendantCount"})
in
#"Reordered Columns" -
Click on "Close & Apply" to close the "Transform Data" window and to apply your changes.
-
You will likely observe a dataset refresh error affecting the "Element-Hierarchy" table.
-
-
Open the Model view
-
Right-click on the relationship between the "Element-Hierarchy" table and the "Element" table and select "Properties"
-
Set the "Cardinality" to "Many to one (*:1)"
-
Press "Save".
-
-
Select the "Element-Geometry" table and click on "Manage Relationships"
-
Click on "+ New Relationship"
-
Set "From table" to "Element"
- Click on the "_key" column header for the "Element" table
-
Set "To table" to "Element-Geometry"
- Click on the "Element" column header for the "Element-Geometry" table
-
Ensure the "Cardinality" is set to "One to one (1:1)"
-
Ensure the "Cross-filter" direction is set to "Both"
-
Press "Save"
-
-
-
In the Report view, press Apply Changes. The report dataset should now successfully refresh.
-
In the Data pane:
-
Right-click and "Delete from model" each item under "Element-Hierarchy > Geometric Analysis"
-
Right-click and "Delete from model" the item "Element-Hierarchy > GeometrySurfaceArea"
-
Update the following "MeasureTable" measures
-
"Total Face Count" - replace with the following:
Total Face Count =
IF (
CALCULATE ( SUM ( 'Element-Geometry'[FaceCount] ) ) = BLANK (),
0,
CALCULATE ( SUM ( 'Element-Geometry'[FaceCount] ) )
) -
Delete the "VIMUrlMessage" measure.
-
-
-
In the Report view, the VIM Power BI Custom Visuals should now display a message stating "Something's wrong with one or more fields. See details". We will resolve this issue in the steps below.
-
In the "Visualizations" pane, click on the "..." button and select "Import a visual from a file".
-
In the "Open" dialog, navigate to directory where you extracted your VIM Enterprise Installer Package and select "vimviewer.0.95.0.2.pbiviz", then press "Open", and press "Update" to confirm the replacement. Press "Ok" to proceed.
-
🔃 Repeat the following for each occurrence of the VIM Power BI Custom Visual in your report:
-
Click on the VIM Power BI Custom Visual to select it.
-
In the "Visualizations" pane...
-
Click and drag "Element-Hierarchy > Descendant" from the "Data" pane into the custom visual's
*Element-Hierarchy[Descendant]
field. Important: this field will not present an error icon âš but must be replaced. -
Click and drag "Element-Hierarchy > Node.Index" from the "Data" pane into the custom visual's
*Element-Hierarchy[Node.Index]
field. -
Click and drag "Element-Hierarchy > Geometry.Index" from the "Data" pane into the custom visual's
*Element-Hierarchy[Geometry.Index]
field.
-
Upon success, the custom visual should no longer display the error message.
-
Press Save to save your work and repeat the process for each page containing the VIM Power BI Custom Visual.
-
-
-
Press Save to save your work.
-
-
Specific report page upgrades...
-
"Meshes - By Model"
- One of the controls' fields references "Total Geometry Faces". Replace this field with "Element-Geometry > Face Count"
-
"Families (No Geometry)"
-
Some filters on this report page contain a missing reference to "FaceCount" which must be updated. For each affected widget:
-
Remove the previous FaceCount filter.
-
Drag the "Element-Geometry > FaceCount" into its Filters.
-
Set "Show items when the value" > "is" > "0"
-
Press "Apply filter"
-
-
-
Press Save to save your work.
-
🎉 At this point, your Power BI report should be compatible with Release v1.2.133.