Uniqueness 

Relationships in Power BI Data Models are always defined between a single column from each of the two tables. One of these two columns must uniquely identify the rows of its table, such as the Currency Key column from the Currency table in the Fact-to-dimension relationships section earlier in this chapter. Power BI will throw an error message if a row with a duplicate value for the relationship column is attempted to be loaded to the one side of the relationship, as shown in the following screenshot:

Uniqueness enforced in relationships

Power BI and SSAS Tabular models do not enforce or require referential integrity as with relationship uniqueness, however. For example, a sales fact table can contain transactions for a customer that is not present in the customer dimension table. No error message will be thrown and DAX measures that sum the sales table will still result in the correct amount, including the new customer's transactions. A blank row is added to the customer dimension table by default for these scenarios (also known as early-arriving facts) and this row is visible when the measure is grouped by columns from the customer dimension table in report visualizations. If missing dimensions is an issue, the dataset designer can work with the data source owner and/or the data warehouse team to apply a standard foreign key value (for example, -1) to these new dimension members within an extract-transform-load (ETL) process and a corresponding row can be added to dimensions with an unknown value for each column.

In the rare event that a text column is used for a relationship, note that DAX is not case-sensitive like the M language. For example, M functions that remove duplicates, such as Table.Distinct(), may result in unique text values (from M's perspective), such as Apple and APPLE. When these values are loaded to the data model, they will be considered duplicates and thus relationships will not be allowed. To resolve this issue, a standard casing format can be applied to the column within a Table.TransformColumns() function via text functions, such as Text.Proper() and Text.Upper(). Removing duplicates after the standard casing transformation will result in a column of unique values for the data model.
..................Content has been hidden....................

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