Retail · Power BI
Loading and relating an 8-table retail schema in Power BI
Independent grading: 95/100(verify, opens in a new tab)
Problem
Meridian Retail (simulated retailer) had a known revenue discrepancy that the finance team needed to investigate. Nura Ibrahim, the stakeholder, asked me to connect Power BI Desktop to the Meridian PostgreSQL database and load all 8 required tables in Import mode before any visual work could begin.
What I did
Using minimal M code, I connected each table to the Neon PostgreSQL server by referencing the correct schema and item name within the source. Power BI auto-detected 9 relationships from the schema, and I confirmed each one reflected the correct grain: orders to customers, order items to orders and products, inventory to products and stores, and sessions to both orders and customers. The sessions-to-customers relationship was left inactive to prevent ambiguous filter paths, since sessions already connects to customers through orders.
Finding
All 8 tables loaded correctly with key columns present, including total_cents on orders, is_duplicate on customers, and stock_qty on inventory, giving the model a clean foundation for the revenue discrepancy analysis.
Outcome
Nura had a fully connected data model ready for Power Query transformation and visual development, with no missing tables and no broken relationships.
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 pattern, repeated for each of the 8 tables, connects to the correct server and database and pulls one schema-qualified table into Import mode.
Next step
A useful next check would be to verify row counts for each table against the source database, to confirm that Import mode captured the full dataset and not a truncated preview.
- PostgreSQL database connection in Power BI Import mode
- Power Query M code authoring
- Relationship management including inactive relationship configuration