Retail · Power BI
Loading and modelling eight Meridian tables in Power BI with a star-schema structure
Independent grading: 100/100(verify, opens in a new tab)
Problem
Before any visual analysis of the revenue discrepancy could begin at Meridian Retail (simulated retailer), Nura Ibrahim needed all relevant source tables available in Power BI. The task was to connect to the PostgreSQL database, load eight specific tables in Import mode, and establish the relationships between them.
What I did
Each table was loaded using PostgreSQL.Database() in Power Query, pointing to the correct server and database, with Import mode selected so data would be cached locally for fast reporting. Seven relationships were defined to link the tables: order_items to orders and products, sessions to orders, inventory to products and stores, orders to stores, and products to categories. This set of joins produces a star-schema structure with orders and order_items at the centre. Proactive type-change steps were also added in Power Query for columns known to have capitalisation inconsistencies, casting channel, status, and payment_method to text in the relevant tables.
Finding
All 8 tables loaded correctly with 7 relationships confirmed, and the model reflects the key joins needed for revenue, inventory, and customer analysis.
Outcome
The semantic model gave Nura a connected, Import-mode dataset ready for DAX measures and visual development in subsequent tasks.
let
Source = PostgreSQL.Database("ep-frosty-glade-ab4k8hyw-pooler.eu-west-2.aws.neon.tech", "meridian_retail"),
retail_categories = Source{[Schema="retail",Item="categories"]}[Data]
in
retail_categoriesThis M code connects to the Meridian PostgreSQL database and retrieves the retail.categories table by schema and item name, the pattern repeated for all eight tables in the model.
Next step
With the model in place, a useful next check would be to verify row counts in Power BI against the SQL layer for each table, to confirm Import mode loaded complete data and no rows were silently dropped during connection.
- PostgreSQL connection via PostgreSQL.Database() in Power Query
- Star-schema relationship modelling in Power BI
- Import mode data loading in Power BI
- Power Query column type casting