0

I'm looking at Product dimension table.

It has got products table obtained by performing a SQL UNION between Product tables in 2 databases. The columns are: Dbname,productid,productname,productcategory

The same product name exists in both databases but with different ID. The unique key of this table is concat(dbname,productid).

Similarly, the sales table is created using the UNION approach and is related to product table on dbname,productid.

I have brought the product and sales tables into the power bi data model, and created a new column in both tables called key (concat dbname,productkey). And then created a relation on the dbname.

4
  • None. What are you concerned about? Commented Aug 9, 2024 at 16:09
  • The product name duplicating isn't something I have ever seen before in any Product dimension table. So I wanted to get some guidance. Commented Aug 9, 2024 at 16:41
  • The ID is unique though, right? Commented Aug 10, 2024 at 0:24
  • Yes the id (concat of dbname and productid) is unique and this is linked to the fact table. The key is not an issue. Just that I've never experience product names repeating in the past. Commented Aug 10, 2024 at 2:37

1 Answer 1

1

This is similar to the situation where multiple customers have the same name. The default situation is for PowerBI to aggregate common values together. e.g. the following table:

enter image description here

when placed in a table visual looks like this.

enter image description here

Even though there are two John Smiths who are separate people, they have been aggregated. To avoid this, set a key on the table and a row value like this:

enter image description here

When you add the same columns to a table, they will now be separate.

enter image description here

Sign up to request clarification or add additional context in comments.

4 Comments

The above screenshot of properties is of the table visual or the table in the model?
Table in the model
Should the key be the productid? Or the concatenated key (dbname, productid)
Whatever represents your unique key in the table

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.