Skip to content
All posts Analytics

Import and DirectQuery Walk Into a Tea Stall

Reena's dashboard has to do two things at once: slice three years of sales instantly, and show stock that is right to the minute. One storage mode can do the first, the other the second, and her cousin wants both by Sunday.

Dr. Rani C — Yuvijen Dr. Rani C 11 min read
Stylised illustration of a tea stall. On the left a woman in ochre stands beside a large packed trunk with a clock on its lid reading six in the morning, everything she needs already inside it. On the right a man in deep teal holds a telephone handset whose cord runs off the edge of the frame towards a warehouse, with a small clock beside him reading now. Reena stands behind her counter between them with her laptop open.

It’s a Friday morning. The kettle hisses. The fan turns slowly above the counter.

Reena has built the model her cousin asked for, and it is fast. Three years of till data — 4.2 million rows — loaded into Power BI, cleaned in Power Query, shaped into the star schema she learned the hard way. She clicks a slicer and the whole dashboard redraws before her finger leaves the mouse.

Then the cousin’s message arrives, and it contains the word also.

“Looks good. Also add the supplier’s stock table. I need to see what’s actually in the godown right now — not this morning, right now. If it says 40 packets and there are 3, I order wrong.”

Reena types back, “The sales data refreshes at 6 a.m. I’ll add stock to the same refresh.”

“No. Right now. Not 6 a.m.”

She looks at her model. Everything in it is a copy, taken at six o’clock this morning. That is exactly why it is fast. And it is exactly why it cannot tell anybody what is in the godown right now.

She mutters, “Fast or current. Why can’t I have both?”

The awning rustles.

A woman steps in under the awning — solid, unhurried, ochre shirt, and she is dragging a large packed trunk behind her. It is heavy. She parks it beside the counter with the air of someone who has already done the hard part. On the lid, a small clock face reads 06:00.

She says, “I am Import. Before you opened today, I went to the source, took a copy of everything you asked for, compressed it, and put it in this trunk. It is all in here. You will never wait for me.”

A man walks in behind her — lean, alert, deep teal shirt, holding an old telephone handset. Its cord runs out from under the awning and away down the road, towards the godown. He is not carrying anything at all.

He says, “I am DirectQuery. I store nothing. When somebody asks a question, I pick this up, call the source, and read back what it says at that moment.”

Reena looks at the trunk, then at the cord disappearing down the road.

She says, “So she is this morning, and you are right now.”

They reply, together, “And that is the only real difference between us.”

Import speaks first

Import flips the trunk open. Inside, everything is packed far tighter than seems reasonable.

She says, “Start with why I am fast, because people think it is just because it is local. It is more than that. When I take the copy I do not store your table as rows. I store it column by column, and I compress each column on its own.”

She lifts out a column of 4.2 million dates. “Your date column has maybe 1,100 distinct values repeated over and over. I keep the 1,100 once and store pointers. Your product column has 38 values. Same trick. That engine is called VertiPaq, and it is why your 180 MB of till data sits in about 42 MB of model and answers in a third of a second.”

Reena says, “So why would anyone not use you?”

“Three reasons, and I will give you all three honestly.”

She counts them on the lid of the trunk.

“One. I am a copy, so I am always as old as my last refresh. Six o’clock this morning. Not a minute newer, however many times you click.

Two. I have to fit. Everything I hold lives in memory. On a Pro workspace a single model is capped at 1 GB compressed. Your 4.2 million rows are nowhere near it. A billion rows of transactions would be.

Three. Refresh is a scheduled event, and the schedule has limits. On Pro you get 8 scheduled refreshes a day. On Premium or PPU, 48. That is one every half hour at best — and at best is still not now.”

She closes the lid. “For three years of history that nobody is editing, I am the right answer and it is not close. History does not change. There is no reason to phone anybody about 2024.”

DirectQuery speaks

DirectQuery holds up the handset so Reena can see there is nothing else in his hands.

He says, “I am the opposite trade. I keep no copy, so I have nothing to go stale. When your cousin opens the report, I turn each visual into a query — real SQL, sent to the source — and I show what comes back.”

Reena says, “So the godown number is always right.”

“It is right as of the moment the visual drew itself. That is what he asked for, and I am the only one of us who can give it to him.”

He lowers the handset.

“Now my honest list, and it is longer than hers.”

“One. Every click is a phone call. Her trunk answers from memory. I answer from the source. If your page has 12 visuals and your cousin moves one slicer, that is a dozen queries down this cord — and his wait is whatever the source takes, plus the trip. A slow table on their side is a slow dashboard on yours, and no amount of tidy DAX fixes it.”

“Two. I cannot do everything she can. Some DAX simply is not available to me, time intelligence is awkward, and anything I can do gets translated into SQL and run on their server. A calculated column in my world is computed at query time, every time.”

“Three. If the source is down, I have nothing. She will happily serve a report from a trunk at midnight on a holiday. If the godown’s server is offline, my report shows an error, because the data was never here.”

Reena says, slowly, “So the stock table should be you. And the three years of sales should be her.”

He says, “Yes. And the thing that trips people is that you do not have to choose once for the whole model.”

What just happened

Reena pours herself a glass of tea, sits on her own counter, and writes it out.

ImportDirectQuery
Where the data livescopied into the modelstays at the source
Speedfast — answers from memoryas fast as the source, plus the trip
Freshnessas of last refreshas of now
Refresh8/day on Pro, 48 on Premiumnone needed
Size limitmodel must fit (1 GB on Pro)no model to fit
DAXeverythinga restricted set
If the source is downstill worksreport fails
Right forhistory, big slicing, full modellinglive operational numbers

She looks at the last row and writes one more line underneath: you can have one table of each.

Import says, “That is a composite model. Set the storage mode per table, not per report. Your three years of sales: Import. His stock table: DirectQuery.”

DirectQuery adds, “And one piece of advice that will save you a week. Your shared dimension tables — Date, Product — set those to Dual. Dual means the table behaves as Import when an Import visual asks, and as DirectQuery when I ask. Leave them as plain Import and every one of my queries has to reach across to them, which is slow and sometimes refuses to join at all.”

The same chat, in a chart

Animated three-panel figure. Panel one, Import: a trunk packed with compressed columns sits next to the report, the query path runs only from the visual to the model, a clock on the trunk reads 06:00, and a note says 4.2 million rows compress from 180 MB to about 42 MB. Panel two, DirectQuery: no trunk, and the query path runs from the visual out along a telephone cord to the source and back, with a clock reading now and a note that twelve visuals mean twelve queries. Panel three: Import standing beside her trunk and DirectQuery holding a telephone handset, with a composite model strip beneath showing a Sales table set to Import, a Stock table set to DirectQuery, and Date and Product dimensions set to Dual.

That picture is the same conversation, drawn. The first panel is the short path: the question never leaves the building. The second is the long one: every question goes down the cord and comes back. The strip underneath is the answer Reena actually shipped — not one mode for the report, but a mode per table.

One last warning before they leave

DirectQuery winds the cord around his hand.

He says, “Three traps, and the first one is mine to own.”

“One. My speed is not yours to tune. People open Performance Analyzer, see three seconds, and start rewriting measures. The measure is usually innocent. The query went to a table with no index on the column your slicer filters. Fix it at the source — index it, add a view, aggregate it — or you are polishing the wrong thing.”

“Two. Watch what a slicer costs. A page with many visuals fires many queries per interaction, and the source feels every one. Cut the number of visuals on a DirectQuery page, avoid putting a high-cardinality column in a slicer, and let the obvious aggregates live in an Import table instead.”

Import adds, “Three, and this one is mine. Do not reach for him just because the data feels like it should be live. Ask what decision the number drives. Your cousin’s stock number drives an order he places this morning, so it must be current. Last year’s sales by category drive nothing that cannot wait until 6 a.m. Live is a requirement, not a virtue — and every table you make live, you pay for on every click, forever.”

Reena writes all three down. Fix DirectQuery at the source. Count the visuals. Only go live where the decision needs it.

The bill

They left the way people leave a tea stall on a working morning. Import dragged her trunk back out under the awning, slowly, and did not ask for help. DirectQuery went out reeling in his cord, hand over hand, until it disappeared down the road after him.

Reena rebuilt the model that afternoon. Sales, three years, 4.2 million rows: Import. The supplier’s stock table: DirectQuery. Date and Product: Dual. One report, two storage modes, and a line in her notes about why each table is what it is.

On Sunday her cousin clicked through the category slicers and said nothing at all, which is how she knew the Import side was working. Then he looked at the stock page, said “forty-one packets”, and phoned the supplier while standing there.

Reena wrote the sentence she wanted to keep:

Import is a copy you can fly through. DirectQuery is a phone call you pay for every time. Choose per table, not per report.


For the math-curious

Why Import compresses so well. VertiPaq stores data column-by-column and applies dictionary encoding, run-length encoding and value encoding per column. Compression therefore depends on cardinality, not row count: a column with 1,100 distinct dates across 4.2 million rows stores the dictionary once plus narrow pointers. The practical consequence is counter-intuitive — removing a single high-cardinality column (a transaction ID, a timestamp to the second) can shrink a model more than deleting millions of rows.

Query folding. In DirectQuery, both Power Query steps and DAX measures must be translatable into the source’s SQL. When a step cannot fold, the engine either refuses it or pulls more data than you expect. SUM over a column folds cleanly; row-by-row iteration over a large table does not fold into anything the source enjoys running.

Storage modes in a composite model. Each table is Import, DirectQuery or Dual. Dual tables are materialised both ways, so a dimension can serve an Import fact from memory and a DirectQuery fact over the wire without creating a cross-source join. Relationships that span storage islands become limited relationships, which are evaluated differently and cannot use the fast in-memory path — which is precisely why shared dimensions should be Dual.

Aggregations. A common production pattern keeps a DirectQuery fact table at full detail and adds a small Import aggregation table at, say, day-by-category grain. The engine answers from the aggregate when the query can be satisfied there, and silently falls through to DirectQuery when it cannot. Readers get Import speed for most questions and live detail when they drill.

Refresh limits. Scheduled refresh is capped at 8 per day on Pro and 48 on Premium or PPU; incremental refresh partitions a table so only recent partitions reload. None of this makes Import current to the minute — if that is the requirement, it is a DirectQuery requirement.

One of them brings everything in and answers from memory. The other keeps nothing and asks the source each time. The model that works is usually both.

Dr. Rani C — Yuvijen

Written by

Dr. Rani C · Educator · Business Intelligence

UGC NET (Management) qualified · HR Business Intelligence · 10+ years in teaching & research

All posts → drcrani.com ↗

Stay in the loop

Follow Yuvijen on LinkedIn.

New posts, research notes, and analytics tips — straight to your LinkedIn feed.

Follow on LinkedIn

linkedin.com/company/yuvijen · no signup needed

Free newsletter

One new explainer a week, in plain language

Statistics and analytics concepts explained simply — new posts, new tools, no spam.

What you get, and past issues

Topics (optional)

One email on the 1st of each month · no spam · unsubscribe anytime