Bridge tables

For this dataset, bridge tables are used to link three dimension tables (Sales Territory, Product, and Date) to the Sales and Margin Plan fact table. As shown in the following screenshot from the Relationships View, the bridge tables are hidden from the fields list in the Report View (gray shading) and bidirectional cross-filtering is enabled between the dimension and bridge tables: 

Bridge tables hidden from the Report View

The bidirectional relationships enable filter selections on the three dimension tables (Sales Territory, Product, and Date) to impact the Sales and Margin Plan fact table as well as the Internet Sales and Reseller Sales fact tables. Given the higher granularity of the dimension tables relative to the Sales and Margin Plan (for example, individual dates versus months), the bridge tables with distinct values (the one side) and bidirectional cross-filtering support the core requirement of analyzing historical sales data (Internet and Reseller Sales) versus the Sales and Margin Plan

As described in the Bridge Tables Queries section of Chapter 2Connecting to Sources and Transforming Data with M, a Table.Distinct() M function can be used against the column from the given dimension table query that aligns with the granularity of the Sales and Margin Plan table.

For example, the Sales and Margin Plan fact table contains rows per Product Subcategory, thus the Product Subcategory bridge table contains one row for each unique Product Subcategory value via the following M expression: 

let
SubCats = Table.SelectColumns(Product, {"Product Subcategory"}),
DistinctSubCats = Table.Distinct(SubCats)
in
DistinctSubCats

The existing M Query for the Product dimension table, which references the data source staging query (AdWorksSQLServer) and the SQL view of the dimension (BI.vDim_Product), is leveraged by the bridge table query. The M Queries for the bridge tables generate simple SQL statements ("Select Distinct..") for execution by the source system. Additionally, with the Include in report refresh query property set to true, any new dimension values are automatically retrieved into the dataset. 

..................Content has been hidden....................

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