Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Build my plan
Optimizing Power BI Models
00:00
5 left

Optimizing Power BI Models

MediumSQL · PostgreSQL

Problem

How do you optimize data models for performance when working with very large files in Power BI?

Use the metadata below to identify which tables are the biggest refresh bottlenecks. Return the largest tables by estimated model size, along with their row counts, column counts, and last refresh time. Ignore rows where estimated_size_mb is NULL.

Output

  1. One row per table in the Power BI model
  2. Columns: table_name, row_count, column_count, estimated_size_mb, last_refresh_at
  3. Include only tables with a non-NULL estimated_size_mb
  4. Sort by estimated_size_mb descending, then row_count descending, then table_name ascending

Schema

powerbi_tables
ColumnTypeDescription
table_idPKINTPrimary key for the table metadata
table_nameVARCHAR(100)Power BI table name
row_countINTEstimated number of rows in the table
estimated_size_mbNUMERIC(10,2)Estimated model size in megabytes
last_refresh_atTIMESTAMPTimestamp of the last refresh
powerbi_columns
ColumnTypeDescription
column_idPKINTPrimary key for the column metadata
table_idINTReferences powerbi_tables.table_id
column_nameVARCHAR(100)Column name in the Power BI table
data_typeVARCHAR(50)Column data type
is_hiddenBOOLEANWhether the column is hidden in the model
Tablespowerbi_tablespowerbi_columns
Interviewer

Your question is Optimizing Power BI Models. Start with the requirements and the two tables in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePostgreSQL
Sign up free to run your codeLog inLn 1
Run your query to see results here.