What the Lantern tools told me about a Power BI model in one hour
I have developed Power BI models for years.
You develop and develop, and at some point you lose the picture: the model has grown so large that you do not understand it anymore.
It happened to me with models I had worked on for three years and that other developers had built on since, and I dreaded opening some of them.
The portrait was built for exactly that.
After one hour with it I had found most of the problems in those models and had a plan of action.
The same happened with models other people had created: with the drawing I took the time to understand them and correct them.
This is one such hour, on brume, a synthetic online shop.
brume is a shop I use to build and test. The model was generated from my own modelling patterns by an AI assistant under my brief, which is why I had not built it line by line and did not trust it yet.
The brume model is one of the three sample models on the landing page, and the button below opens it in the tool, so you can open the same drawings and follow along.
The purpose was to understand it well enough to work with it and to know what to improve.
How to read the portrait



The full key, with the panes and the hands, is on How to read the portrait.
Start with the facts

Six facts sit on the innermost ring: sessions, sales, attribution, and three ad facts at different breakdowns. Orders is a seventh, one ring out, because it filters sales.
From that alone I know what the business is: an online shop with web sessions, orders and ad spend.
I click the facts one by one and open the grain pane for each, to see what the table is about and which tables filter it.

Attribution draws my eye. What is it?
The grain says it: one row per date and channel, with Shopify orders, GA4 orders and Meta purchases side by side.
It is a table that reconciles three counts of the same thing.

Sessions carries the inner ring: incremental refresh. That is good practice for a sessions table.
The ad facts and the order lines could have it too, but at this size it is not needed.
Move to the outer rings

The second ring holds the dimensions that govern the model: age, gender and country for the customer, an acquisition calendar that filters the customer, the ad.
The orders chain is the one to understand.
Age and gender filter the customer, the customer filters orders, orders filter sales, and product filters sales.
Product category filters orders through the order's first product category, and it also filters the ad, so it filters spend.
Here is the first thing I do not agree with. Age filters the customer.
When I look at sales by age, I want the age of the customer at the time of the order, not the age they have now.
The warehouse took this into account, because sales carries its own age range column.
So age should filter sales directly, not the customer.
Gender and country are fine on the customer; those do not change over time, most of the time.

One trap for users in that chain: the product category filter looks like revenue per product category.
It is revenue from orders whose main product is in that category.
Stop at the interesting parts
Orders has a switched-off join to sessions on the transaction id, and sessions is also filtered by the customer.
That is a triangle: orders, sessions, customer.
Both ropes into sessions are orange, which means key values cross the join without a match: there are sessions without an order and sessions without a customer, as expected.
The sessions without a customer show up as the blank member in every customer slicer and breakdown. The usual fix is an explicit unknown-customer row in the warehouse.
The join from orders is one to one, so whatever is of interest there can be computed in the warehouse instead.
The join from the customer is one to many, so we can see a customer's sessions.
The question it raises is whether stitching was done in the warehouse.
Stitching means the user pseudo id is tied to the customer id through the orders, so the customer's sessions before the first purchase, and the sessions without a purchase, are backfilled.
Identify improvements

There are few Power Query steps, which is good: the processing happens in the database.
There are calculated columns that can move to the warehouse: the order's first product, its first product category, and the order age bucket.

The ad set and campaign tables are a snowflake off the ad, three rings out.
They do not earn their place. I would keep everything in the ad table.
Understand the calculation groups

I switch to the measure lineage, one level at a time and the down arrow only, because I want to see how things progress and what is built on what.
I was looking for the top tables in the measures and did not find them, so I go back to the portrait and look at the calculation groups. There are eight.


The cohort formulas use the order age bucket table, so that table is not about the customer's age at all.
It is about cohort behaviour since the first order, and it pairs with the group to compute metrics at milestones of a cohort.

The top items filter uses the top tables and a selection parameter, so a slicer on the page controls how many products show and the rest fold into Other. That is smart.
There is also a lot of use of field parameters, for measures and for dimensions, and I look through them one by one.
Investigate the measures


Back in the lineage, the big picture looks healthy. The tree of the ad facts is the interesting one.
Each fact builds its own base measures, and they all feed one spend measure through a selector.
The three facts reconcile to the same spend, so the one with the lower total is the one a filter has touched, and that is the one read.
The other ad metrics work the same way, always through the spend selector.
One warning for whoever builds reports on it: the selector reads one breakdown at a time. A page that filters country and age together gets the lower of the two totals, and the other filter is silently dropped. The report has to say so to business users, or block the combination.
Between the selector and spend there is an ex layer: ex_spend does the switching, and spend only repeats it.
There is no reason for that name. The code belongs in spend, and the ex layer goes.
Find what does not make sense

CAC is as easy as I expected. Contribution profit is the interesting one.
The customer lane computes projected repeat gross profit as new customers times APRP, so we predict how much the new customers will bring.

APRP is the key measure, and it is lifetime repeat profit divided by lifetime customers.
Here I have a problem.
That is the projected repeat profit per new customer averaged over all customers, whether they came years ago or yesterday, and averaging those does not make sense. It is the naive way.
A better way is a threshold, repeat gross profit at six months, one year or two years, and only the last cohorts that have completed that threshold go into APRP.


One level down, lifetime repeat profit is the measure APRP stands on, and I did not understand it at first.
For each customer it takes the lifetime profit and subtracts the lifetime profit divided by the lifetime orders, which is the customer's average profit per order.
Subtracting one average order is the author's way of removing the first order, so what remains is the repeat profit.
The customer table holds only lifetime totals, so the measure guesses that the first order earned the average, and the guess is doing all the work.
It is also not needed: the orders fact already numbers each customer's orders, so the repeat profit is the profit of every order after the first.
Conclusion
I understand the model well enough to work with it, I know what to improve, and I have what to bring to the table.
What is good:
- The model follows good Power BI modelling practice: a star schema, the facts in the centre, the dimensions one join out.
- It uses calculation groups and field parameters, which makes it easier to use, understand, extend and modify.
- The top items filter is a particularly smart use of Power BI to improve the user's experience.
- The spend measure uses the filter context to pick the breakdown fact the current filter touches.
What to improve:
- Age should filter sales directly, not the customer. Otherwise any breakdown of revenue or orders by age moves in time. Country and gender do not carry this restriction, because most of the time they do not change.
- The product category filter reads as revenue per category, and it is revenue of orders whose first product is in the category.
- Move the calculated columns to the warehouse.
- Fold the ad set and campaign tables into the ad table.
- Give spend the code of ex_spend and remove the ex layer.
- Warn report users that the spend selector reads one breakdown at a time, or block country and age together.
- Compute APRP over the last cohorts that have completed a threshold, six months, one year or two years.
- Compute lifetime repeat profit from the orders fact, where the order's sequence number already marks the first order, or add the first order's profit to the customer table.
To do this on your own model, export model.bim from Tabular Editor and model.vpax from DAX Studio, two steps each, and drop both on lanternbi.com. The drawing is made in your browser. Nothing is uploaded.
The tool is free to use as many times as you want, and you can take as many snapshots as you like. If you want to download the two views to keep, that costs $4.99 per model, one pack with both views.