Difficulty Rating: 2 out of 5
The phone rings. It’s a call from a potential new client (an office supplies store) who says that their Power BI report isn’t working and asks if you can help. You tell them to send over their data model populated with some sample data and you’ll take a look.
As soon as you look at the model, you see three big problems:
-
The first problem is the Products table. They’ve got it set up as a snowflake structure, which while not technically wrong is going to cause problems with the slicers syncing properly, is likely to decrease performance of the report, and make the DAX more complicated. You definitely are going to de-normalize this down to a single Products table incorporating category, subcategory and product.
-
The second problem is the Customer table. This should have a one-to-many relationship with the Orders table, not a many-to-many. This problem is caused by the developer misinterpreting the address information. This is not the customer address but is the destination shipping address. Thus, you need to remove this information from Customer table and move place the city field in the Destinations table. Once that’s done, fix the relationship between the Customer table and the Orders table.
-
Finally, the Destinations table currently has no relationship to the fact table. You could connect the tables with the Postal Code field, but you’d rather use an integer key, and if you change the postal code to an integer you will lose the leading zero on some of the ZIP Codes. So, instead create a new numeric Destination ID key field (1001, 1002, 1003…) linking the Destinations and Orders tables.
You call the client back and explain what you found. They agree to your hourly rate and ask you to go ahead and fix the report.
To document that you’ve got it working correctly, post a screenshot of your revised data model and a screenshot of the report page with each of the slicers activated (the blank one gets the moved City field). Good luck!
I will post my solution, Sunday April 30.
Data Modelling Workout 03 - Denormalize and Fix Dimensions.pbix (826.6 KB)
Data Modeling 003.xlsx (1.4 MB)