Case study

H Mart: an FMCG distributor in Power BI

Two years of a Mandya wholesale and retail business, from the first summary card to the audit tests. The most useful findings are the numbers that look wrong.

All of this data is synthetic. H Mart, its customers, staff and brands were generated for teaching. Nothing here describes a real business.

The business story

FMCG means fast-moving consumer goods: everyday items such as rice, soap and soft drinks that sell quickly, in large volumes, at thin margins. H Mart is headquartered in Mandya, Karnataka. It sells wholesale across the district with a ten-vehicle fleet and runs one retail showroom in Mandya city. It carries 180 products from 12 brands across six departments, from rice to baby food, and serves 340 customers.

Its owner has four questions. Are we growing profitably? Is stock in the right place? Do we deliver what we promise? Does marketing pay for itself? The report answers them in that order, then turns auditor and tests whether the numbers can be trusted. Any unfamiliar term is explained in the KPI glossary.

The model: a galaxy of three stars

Sales, stock and marketing happen at different grains, so each gets its own fact table. Shared dimensions let one slicer speak to all three. This is the report's Model view, read with the shapes from the Semantic Model lesson.

Power BI Model view: FactSales, FactInventorySnapshot and FactMarketingSpend linked to shared dimension tables such as DateTable, DimProduct, DimPlace and DimPromotion, with DimSupplier beyond DimProduct and unconnected helper tables on the right.
Model view of the H Mart report. Select it to open at full size.
Star
Each fact sits at the centre of its own dimensions. FactSales is the biggest star, with DimCustomer, DimSalesperson and DimVehicle around it.
Snowflake
One branch: DimSupplier reaches the facts only through DimProduct.
Star cluster
The two mixed: most dimensions stay flat and only Product branches, because that is all this business needs.
Galaxy
The whole model. The facts share DateTable, DimProduct, DimPlace and DimPromotion, so sales can sit beside stock or marketing spend in one visual.

The tables on the far right of the diagram have no relationships on purpose. They hold measures, slicer parameters and calculation groups, not business data.

Pick a fact to see which dimensions filter it.

The report, page by page

Each page follows one layout: slicers and navigation, a row of cards, two charts, then a table to drill into. Figures in Power BI cards are in millions; the text below uses lakh and crore. Select a screenshot to open it at full size.

Executive Summary

Executive Summary page filtered to FY 2024-25: cards for net sales, contribution margin, fill rate, inventory value and ROMI, a monthly sales line, sales by department bars and a department table.
Shown with FY 2024-25 selected in the slicer.

The question

Are we growing profitably?

The answer

Not quite. Net sales rose 6.3%, from ₹8.56 crore to ₹9.10 crore, while contribution fell from ₹79.45 lakh to ₹76.62 lakh. Margin slipped from 9.3% to 8.4%.

The lesson

Put a growth number and a margin number side by side. Either one alone tells a happier story.

Sales Performance

Sales Performance page: cards for net sales, quantity, invoice count and average invoice value, monthly sales with October peaks, sales by category bars with rice on top, and a customer table.

The question

Where do sales come from, and when?

The answer

Wholesale brings 96.6% of sales. The average invoice is ₹23,111. October is the peak in both years, and rice leads the categories at ₹2.42 crore.

The lesson

The YoY card reads 0.0% when no year is selected, because the previous-year calculation then returns the same two-year total. It only means something once a year is chosen.

Profitability

Profitability page: cards for gross profit, margins, logistics cost and profitable SKU share, a monthly margin line, contribution by brand bars and a department to product table.

The question

What is left after the cost of serving?

The answer

Gross margin of 11.0% becomes 8.8% contribution. Retail earns 22.8% against wholesale’s 8.3%, so 3.4% of sales brings 8.8% of contribution. Soft drinks are thinnest at 6.7%.

The lesson

A small channel can matter more than its sales suggest. A channel slicer shows it; a total never will.

Inventory

Inventory page: cards for inventory value, closing stock, inventory days, stock cover, stockout rate and reorder count, a stock value line, stock by department bars and a product table.

The question

Is the stock right?

The answer

Stock of ₹85.83 lakh covers 22.1 days, or 3.2 weeks. Stockouts run at 0.8%, and 36 products need reordering.

The lesson

Stock is a snapshot, so never add it across weeks. The model keeps it in its own fact table, one row per week, product and location.

Distribution & Service

Distribution and Service page: cards for numeric and weighted distribution at 100 percent, fill rate 93 percent, OTIF 36 percent, on-time 88.7 percent and return rate, with brand bars, a fill rate line and a department to brand table.

The question

Do we deliver what we promise?

The answer

On-time is 88.7% and fill rate 93.0%, yet OTIF is only 36.0%. A line counts as OTIF only if it arrives by the promised date and ships the exact quantity ordered.

The lesson

Strict measures expose what averages hide. So does the drill-down: distribution reads 100% in total, but within Baby Food individual brands reach far fewer customers.

Marketing & ROMI

Marketing and ROMI page: cards for marketing spend, promotion sales and contribution, ROAS 10.85 times and ROMI minus 61.3 percent, with a sales line, ROMI by promotion bars and a promotion table.

The question

Does marketing pay for itself?

The answer

₹32.61 lakh of spend sits behind ₹3.54 crore of promotion sales, a ROAS of 10.85 times. But those sales earned only ₹12.62 lakh of contribution, so ROMI is −61.3%. Only Dasara Deepavali Mega, at +195%, returned more than it cost.

The lesson

ROAS counts sales and ROMI counts margin. On thin-margin FMCG they can point in opposite directions.

Sales Team & Logistics

Sales Team and Logistics page: cards including sales target achievement of 38.6 percent, 14 active salespersons and 39.1 kilometres average distance, with salesperson bars, a sales line and a territory table.

The question

Is the team hitting its targets?

The answer

No: 38.6% of target over the two years, 37.4% in FY 2024-25 and 39.8% in FY 2025-26. An early version of this card said 926.3%, because with no date selected it compared 24 months of sales with one month’s target.

The lesson

Test every measure at the total and with no filters. The active count had a similar flaw: it included the “No Salesperson - Showroom” row, so it read 15 instead of 14 and sales per salesperson was wrong.

Now the auditor’s turn

Four pages use the BeIndian.Audit DAX library to ask a different kind of question: does this data behave as it should?

Audit: Descriptive Analytics

Descriptive Analytics page: summary cards above three statistics tables for sales, profit and invoice amount.

The reading

The average line is ₹7,063 and the median ₹2,028, with skewness of 3.77. A few big lines pull the average up, the largest being ₹1,24,038. At least one line lost ₹3,900.

The lesson

Start an audit by looking at the shape. Average alone would mislead you about a typical sale, and the minimum tells you where to look first.

Audit: Top N Percent

Top N Percent page at 10 percent: cards showing the top transactions at 55.2 percent of sales, two brands, top brand and category bars and a department table.

The reading

At the 10% setting, the top tenth of sales lines carries ₹9.75 crore, or 55.2% of sales. Chamundi and Cauvery Gold make up the top brands.

The lesson

Audit effort should follow value. Testing a tenth of the lines here covers more than half the rupees.

Audit: Benford’s Law

Benford's Law page: cards with a mean absolute deviation of 0.0061 and a verdict of acceptable conformity, actual against expected first digit chart and a digit table.

The reading

First digits of invoice amounts give a MAD of 0.0061, which the report labels acceptable conformity.

The lesson

Conformity is not proof of honesty, and a failure is not proof of fraud. Benford tells you where to look, not what you will find.

Audit: Brand Preference

Brand Preference page: Chamundi as preferred brand with 14.2 percent of quantity, a word cloud of brands sized by quantity, a quantity bar chart and a department table.

The reading

Chamundi leads with 1,08,000 units (rounded), 14.2% of quantity, and ₹3.01 crore of sales. Mysuru Select is second by quantity but not among the top three by contribution.

The lesson

Volume and value are different league tables. The word cloud is a custom SVG measure, drawn entirely in DAX.

How this case study was built

The whole case study was vibe-coded from end to end: described in plain language, built by AI tools, then reviewed.

  1. Synthetic data: an AI-written Python script generated every table, then checked that they reconcile.
  2. Model and report: built with AI through the pbi-cli command-line tool.
  3. Theme: created with Power BI Theme Maker, itself a vibe-coded tool.
  4. Audit pages: built on the BeIndian.Audit DAX library.

So where was the human? Deciding what to build and judging what came back. The target measure ran with no error and read 926%, and it took someone who knew what the number meant to question it. That is why this site teaches concepts first. See Asking AI Well for the prompts.

KPIs in plain language

New to FMCG? These are the terms used on this page, with H Mart’s own figures for the full two years. Three pairs are easy to mix up, so they come first.

ROAS or ROMI?

H Mart spent ₹1 on marketing. That brought ₹10.85 of promotion sales, so ROAS looks excellent. But those sales left only about ₹0.39 of contribution, so it lost ₹0.61 on that rupee, and ROMI is −61.3%.

ROAS asks “how much did we sell?” ROMI asks “did we make money?”

On-time, fill rate or OTIF?

A shop orders 10 cartons for Monday.

  • 10 arrive on Monday: on time and in full, so it counts for OTIF.
  • 9 arrive on Monday: on time, but not OTIF, and the fill rate is 90%.
  • 10 arrive on Tuesday: filled completely, but late, so neither on time nor OTIF.

One line can pass two tests and still fail OTIF, which is why H Mart scores 88.7% and 93.0% but only 36.0%.

Gross or contribution margin?

Sell rice for ₹100 that cost ₹89, and gross margin is ₹11. Delivery and promotion then cost another ₹2.20, leaving a contribution margin of ₹8.80.

Gross margin is profit on the product. Contribution margin is profit after serving the customer. These round figures match H Mart’s overall 11.0% and 8.8%.

Sales and profit

Net sales
Sales after discounts and returns, before tax. H Mart: ₹17.66 crore.
COGS
Cost of goods sold: what H Mart paid for the goods it sold.
Gross profit and gross margin
Net sales minus COGS. The margin is that profit as a share of net sales. H Mart: 11.0%.
Contribution margin
Gross profit minus logistics and promotion costs: what a sale really adds. H Mart: ₹1.56 crore, or 8.8%.
Logistics cost
The cost of getting goods to customers. H Mart: ₹30.01 lakh.
SKU
Stock keeping unit: one sellable item, such as a 5 kg bag of a particular rice. A 1 kg bag is a different SKU.
YoY
Year on year: this year compared with last year. FY means financial year, April to March.
Sales velocity
Net sales per selling day. H Mart: ₹2.42 lakh.
Target achievement
Net sales as a share of the sales target. 100% means the target was met exactly.

Stock

Inventory days and stock cover
How long today’s stock lasts at normal demand. H Mart: 22.1 days, which is 3.2 weeks.
Stockout rate
The share of stock positions with nothing left to sell in the latest weekly count. H Mart: 0.8%.
Reorder count
How many products need ordering again now. H Mart: 36.

Delivery and reach

Fill rate
Of every 100 units ordered, how many were shipped. H Mart: 93.0%.
On-time delivery
The share of order lines delivered by the promised date, even if some units were missing. H Mart: 88.7%.
OTIF
On time, in full: the share of lines delivered by the promised date and with the exact quantity ordered. H Mart: 36.0%.
Return rate
The share of shipped units that came back. H Mart: 0.3%.
Numeric distribution
Of all active customers, the share who bought the item. It counts shops, big or small.
Weighted distribution
The same shops, measured by their share of total sales. Reaching a few big shops can score higher than reaching many small ones.

Marketing

Marketing spend
Money spent on promotions. H Mart: ₹32.61 lakh.
Promotion sales mix
The share of net sales made under a promotion. H Mart: 20.0%.
ROAS
Return on advertising spend: promotion sales for each rupee spent. H Mart: 10.85 times.
ROMI
Return on marketing investment: promotion contribution minus spend, as a share of spend. Below zero means marketing cost more than it earned. H Mart: −61.3%.

Audit

Average, median and skewness
The median is the middle value. When a few very large values pull the average above it, the data is skewed, and skewness measures by how much.
Top N percent
The largest N percent of items, used to see how much of the total they carry.
Benford’s law
In many natural sets of amounts, about 30% start with the digit 1 and fewer than 5% with 9. A very different pattern is a reason to look closer.
MAD
Mean absolute deviation: the average gap between the actual and expected digit shares. Smaller means a closer match.

What to take away

  1. Pair numbers that argue. Sales with margin, ROAS with ROMI, on-time with OTIF.
  2. Model the grain honestly. Sales lines, weekly stock and marketing spend are three facts, not one wide table.
  3. Distrust a number that flatters you. 926% was a filter-context bug that only showed at the total. It took one unfiltered check to catch it.
  4. Then audit it. Shape, concentration, digits and preference take minutes once the functions exist.

Download and explore it yourself

The report and its data are free to download for learning. Everything is synthetic.

  1. Just exploring? Open the PBIX in a current version of Power BI Desktop. The data is already inside, so you need nothing else.
  2. Want to refresh it? Unzip the data set so the files sit in C:\OneDrive\PowerBICourse\FMCG\data, the path the queries expect. For another folder, change each file under Transform data, then Data source settings.
  3. Building your own? Start from the CSV files. data_dictionary.csv explains the columns.