Skip to content

Practical Power BI Interview Questions

44 questions with answers. Hands-on questions where you write code, a query, a formula or concrete steps.

How to approach these questions

Talk while you work: say your approach first, write the simplest correct version, then improve it and mention edge cases.

Solved — practicalStart practicing
3 QUESTIONS FREESign up to unlock the full question bank and track your progress.Unlock every question and answer, then continue practising company-wise and package-wise.
3 questions free Unlock the rest in seconds
01

How do you connect Power BI Desktop to a SQL Server database?

Save to ▾
Show answer
Use Home, Get Data, SQL Server. Enter the server name and optionally the database, choose Import or DirectQuery, and optionally paste a native SQL query under Advanced options. Choose Windows or database authentication, then pick tables in the Navigator and select Transform Data to clean them in Power Query. For scheduled refresh of an on-premises server, an on-premises data gateway must be configured in the Service.
02

How do you publish a report and share it with business users?

Save to ▾
Show answer
In Desktop, choose Publish and select a workspace. In the Service, set up the semantic model's credentials and scheduled refresh. Then create or update an app from the workspace, choose the reports and audiences, and grant access to user groups. Apps give consumers a clean, stable view while authors keep working in the workspace. Avoid sharing from My workspace for team content.
03

What is the PBIP project format and why use it?

Save to ▾
Show answer
Power BI Project (PBIP) saves a report and model as folders of text files instead of one binary PBIX file. The semantic model is stored in TMDL or TMSL and the report in JSON definitions. This makes Git version control, code reviews, diffs and merge of changes practical, and works with Fabric Git integration and deployment pipelines. It is preferred for team development and CI/CD.
04

Write an M query that filters rows, removes columns and changes types.

Save to ▾
Show answer
let Source = Sql.Database("server", "SalesDB"), Orders = Source{[Schema="dbo", Item="Orders"]}[Data], Filtered = Table.SelectRows(Orders, each [OrderDate] >= #date(2024, 1, 1)), Kept = Table.SelectColumns(Filtered, {"OrderID", "OrderDate", "CustomerID", "Amount"}), Typed = Table.TransformColumnTypes(Kept, {{"Amount", Currency.Type}, {"OrderDate", type date}}) in Typed All these steps fold to SQL on a database source.
05

Create a date table in Power Query using M.

Save to ▾
Show answer
let StartDate = #date(2022, 1, 1), EndDate = #date(2026, 12, 31), Days = Duration.Days(EndDate - StartDate) + 1, Dates = List.Dates(StartDate, Days, #duration(1, 0, 0, 0)), T = Table.FromList(Dates, Splitter.SplitByNothing(), {"Date"}), Typed = Table.TransformColumnTypes(T, {{"Date", type date}}), Y = Table.AddColumn(Typed, "Year", each Date.Year([Date]), Int64.Type), M = Table.AddColumn(Y, "Month", each Date.MonthName([Date]), type text) in M
06

How do you add a conditional column in Power Query?

Save to ▾
Show answer
Use Add Column, Conditional Column and define rules, or write M directly: = Table.AddColumn(Source, "Band", each if [Amount] >= 100000 then "High" else if [Amount] >= 25000 then "Medium" else "Low", type text) Adding the type at the end avoids an extra Changed Type step. Conditional columns built here are computed at refresh, not at query time.
07

How do you split a full name column and clean text in Power Query?

Save to ▾
Show answer
Select the column, use Transform, Split Column by Delimiter (space, leftmost) to get first and last names. Then use Format, Trim and Clean to remove extra spaces and non-printable characters, and Capitalize Each Word for consistent case. In M: = Table.TransformColumns(Source, {{"Name", each Text.Proper(Text.Trim(_)), type text}})
08

How do you set up a custom function in Power Query to apply logic to many files?

Save to ▾
Show answer
Write a query for one file, turn the file path into a parameter, then right-click and Create Function. Or write it in M: (path as text) as table => let Src = Excel.Workbook(File.Contents(path), true), Sheet = Src{[Item="Sales", Kind="Sheet"]}[Data] in Sheet Then invoke it on a column of file paths with Add Column, Invoke Custom Function and expand the results.
09

Create a date table with DAX.

Save to ▾
Show answer
Date = ADDCOLUMNS( CALENDAR(DATE(2022, 1, 1), DATE(2026, 12, 31)), "Year", YEAR([Date]), "Month No", MONTH([Date]), "Month", FORMAT([Date], "MMM"), "Quarter", "Q" & QUARTER([Date]), "Weekday", FORMAT([Date], "ddd") ) Then mark it as a date table and sort Month by Month No.
10

How do you mark a table as a date table and why?

Save to ▾
Show answer
In Table view or Model view, select the date table, choose Table tools, Mark as date table, and select the date column, which must be unique, contiguous and without blanks. This tells Power BI to use it for time intelligence and disables the auto date hierarchy for that table. Also turn off Auto date/time under Options, Data Load to avoid hidden date tables for every date column.
11

How do you create a fiscal year column starting in April?

Save to ▾
Show answer
Fiscal Year = VAR m = MONTH('Date'[Date]) VAR y = YEAR('Date'[Date]) RETURN "FY " & IF(m >= 4, y, y - 1) & "-" & RIGHT(IF(m >= 4, y + 1, y), 2) For April 2026 this returns FY 2026-27, which matches the Indian financial year. Add a fiscal month number column for sorting too.
12

How do you use a bridge table for a many-to-many scenario?

Save to ▾
Show answer
For example, accounts can have multiple customers and customers multiple accounts. Create a bridge table with unique Account and Customer pairs. Relate Customer to Bridge one-to-many, and Account to Bridge one-to-many, with the Bridge to Account relationship set to filter in both directions or use CROSSFILTER in measures. Facts relate to Account. Test totals carefully because shared accounts count once per customer.
13

How do you sort a month name column correctly?

Save to ▾
Show answer
By default month names sort alphabetically, April first. In the Date table add a Month Number column, select the Month name column, then choose Column tools, Sort by column, Month Number. The same applies to weekday names and fiscal months. The sort column must have one value per name value, otherwise Power BI shows an error.
14

Write basic measures for total sales, total cost and profit margin percentage.

Save to ▾
Show answer
Total Sales = SUM(Sales[Amount]) Total Cost = SUMX(Sales, Sales[Qty] * Sales[UnitCost]) Profit = [Total Sales] - [Total Cost] Margin % = DIVIDE([Profit], [Total Sales]) Format Margin % as a percentage. Building measures on other measures keeps logic in one place and easy to change.
15

Write a measure for percentage of grand total sales.

Save to ▾
Show answer
Sales % of Total = DIVIDE( [Total Sales], CALCULATE([Total Sales], REMOVEFILTERS('Product')) ) This gives each product's share of total across all products. Use ALLSELECTED('Product') instead if the denominator should respect slicer selections on products.
16

Write a measure for sales of a specific category and region.

Save to ▾
Show answer
Electronics North Sales = CALCULATE( [Total Sales], 'Product'[Category] = "Electronics", 'Store'[Region] = "North" ) Multiple filter arguments are combined with AND. Wrap a filter with KEEPFILTERS if it should intersect with an existing slicer selection instead of replacing it.
17

Create a calculated column that categorises customers by their lifetime sales.

Save to ▾
Show answer
Customer Band = VAR s = CALCULATE(SUM(Sales[Amount])) RETURN SWITCH(TRUE(), s >= 500000, "Platinum", s >= 100000, "Gold", s > 0, "Silver", "No Purchase") This is a column on the Customer table; CALCULATE triggers context transition so each row gets its own customer's sales.
18

Write a measure that counts customers with sales above 10,000.

Save to ▾
Show answer
Big Customers = COUNTROWS( FILTER( VALUES(Customer[CustomerID]), [Total Sales] > 10000 ) ) Iterating VALUES of the customer key keeps the loop small and respects current filters such as year or region.
19

Write YTD, previous year and YoY growth measures.

Save to ▾
Show answer
Sales YTD = TOTALYTD([Total Sales], 'Date'[Date], "31/3") Sales PY = CALCULATE([Total Sales], SAMEPERIODLASTYEAR('Date'[Date])) YoY % = VAR cur = [Total Sales] VAR py = [Sales PY] RETURN DIVIDE(cur - py, py) The "31/3" argument makes YTD follow an April to March fiscal year.
20

Write a 3-month rolling average measure.

Save to ▾
Show answer
Sales 3M Avg = VAR periods = DATESINPERIOD('Date'[Date], MAX('Date'[Date]), -3, MONTH) RETURN CALCULATE( AVERAGEX(VALUES('Date'[Month Year]), [Total Sales]), periods ) AVERAGEX over months averages monthly totals instead of daily values. Month Year must be a column in the date table.
21

Write a running total measure.

Save to ▾
Show answer
Running Total = VAR maxDate = MAX('Date'[Date]) RETURN CALCULATE( [Total Sales], 'Date'[Date] <= maxDate, REMOVEFILTERS('Date') ) REMOVEFILTERS clears the current period filter so all earlier dates are included. In a visual-only scenario, the visual calculation RUNNINGSUM is simpler.
22

Write a dynamic rank measure for products.

Save to ▾
Show answer
Product Rank = IF( ISINSCOPE('Product'[Product]), RANKX(ALLSELECTED('Product'[Product]), [Total Sales], , DESC, DENSE) ) ALLSELECTED ranks within the products visible after slicers, and ISINSCOPE hides the rank on total rows.
23

Write a measure that shows the selected slicer value in a title.

Save to ▾
Show answer
Report Title = VAR r = SELECTEDVALUE('Store'[Region], "All Regions") VAR y = SELECTEDVALUE('Date'[Fiscal Year], "All Years") RETURN "Sales for " & r & " - " & y Use it in a visual title through conditional formatting, Title text, Field value. SELECTEDVALUE returns the fallback text when zero or multiple values are selected.
24

Write a measure that counts new customers in a period.

Save to ▾
Show answer
New Customers = VAR minDate = MIN('Date'[Date]) RETURN COUNTROWS( FILTER( VALUES(Sales[CustomerID]), CALCULATE(MIN(Sales[OrderDate]), REMOVEFILTERS('Date')) >= minDate ) ) A customer is new if their first ever order falls in the current period.
25

How do you set up drill-through to a customer details page?

Save to ▾
Show answer
Create a new page named Customer Details, add visuals showing customer information, orders and trends, and drag Customer Name or Customer ID into the Drill through well in the Visualizations pane. Power BI adds a back button automatically. Users can now right-click a customer in any visual and choose Drill through, Customer Details, and the page opens filtered to that customer.
26

How do you create a measure-driven conditional colour?

Save to ▾
Show answer
Sales Colour = VAR ach = DIVIDE([Total Sales], [Target]) RETURN SWITCH(TRUE(), ach < 0.9, "#D64550", ach < 1, "#F2A93B", "#2E9E5B") In the visual, open conditional formatting for background or font colour, choose Format style Field value and select this measure.
27

How do you build a toggle between a chart and a table using bookmarks?

Save to ▾
Show answer
Place a chart and a table in the same position. In the Selection pane hide the table and create a bookmark named Chart View with Data unchecked so filters are not saved; then show the table, hide the chart and create Table View. Add two buttons and set each button's action to the matching bookmark. Group the visuals to keep the layout tidy.
28

How do you create a dynamic axis using field parameters?

Save to ▾
Show answer
Go to Modeling, New parameter, Fields, and add the fields such as Region, Category and Channel. Power BI creates a parameter table and slicer. Put the parameter field on the axis of a chart; users select which dimension to show from the slicer. You can add measures to a separate field parameter so users switch both the measure and the axis.
29

How do you build a custom tooltip page?

Save to ▾
Show answer
Create a new page, set Page information, Allow use as tooltip on, and set Canvas settings to the Tooltip size. Add small visuals like a monthly trend line for the hovered item. On the main visual, go to Format, Tooltips, set Type to Report page and select the tooltip page. Fields in the main visual automatically filter the tooltip page on hover.
30

How do you test row-level security?

Save to ▾
Show answer
In Desktop use Modeling, View as, select a role and optionally Other user with an email to simulate dynamic RLS, and check visuals show only expected rows. In the Service open the semantic model's Security settings, select a role and use Test as role. Test with real sample users from different regions and a user with no mapping, who should see no data, and confirm totals match expectations.
31

How do you configure incremental refresh on a sales table?

Save to ▾
Show answer
In Power Query create RangeStart and RangeEnd parameters of type Date/Time, and filter OrderDate so it is greater than or equal to RangeStart and less than RangeEnd. Confirm the step folds to the source. In Desktop right-click the table, choose Incremental refresh, set to archive, say, 5 years and refresh the last 10 days, optionally detect data changes. Publish, and the Service creates partitions on first refresh.
32

Write a dynamic RLS rule using a security mapping table.

Save to ▾
Show answer
// Security table: Email, Region; related to Region[Region] // Role filter on Security table: [Email] = USERPRINCIPALNAME() // Optional all-access rule on Region table instead: VAR u = USERPRINCIPALNAME() RETURN LOOKUPVALUE(Security[Region], Security[Email], u) = "ALL" || Region[Region] IN CALCULATETABLE(VALUES(Security[Region]), Security[Email] = u)
33

How do you set up scheduled refresh in the Power BI Service?

Save to ▾
Show answer
Open the workspace, select the semantic model's settings, and check Data source credentials and Gateway connection, mapping on-premises sources to a gateway. Then turn on Scheduled refresh, choose time zone, frequency and time slots, and add failure notification contacts. Pro allows up to 8 refreshes per day and Premium or Fabric capacity up to 48. Stagger refresh times to avoid source load peaks.
34

How do you use Performance Analyzer in Power BI Desktop?

Save to ▾
Show answer
Open View, Performance Analyzer, click Start recording and then Refresh visuals or interact with the page. Each visual shows total duration split into DAX query, visual display and other. Sort by duration to find the slowest visuals, expand them and choose Copy query to paste into DAX Studio for deeper analysis. Clear the cache between tests so timings are realistic.
35

How do you analyse model size with DAX Studio?

Save to ▾
Show answer
Connect DAX Studio to the open Power BI Desktop file, go to Advanced, View Metrics to run VertiPaq Analyzer. It shows size per table and column, cardinality, encoding and relationship sizes. Sort columns by total size to find the biggest consumers, often IDs, timestamps or long text. You can export a vpax file to compare before and after optimisation or share with colleagues.
36

Rewrite a slow measure to use variables and avoid repeated calculation.

Save to ▾
Show answer
Before: Growth = IF([Sales PY] = 0, BLANK(), ([Total Sales] - [Sales PY]) / [Sales PY]) After: Growth = VAR cur = [Total Sales] VAR py = [Sales PY] RETURN DIVIDE(cur - py, py) The previous year measure is now evaluated once instead of three times, and DIVIDE handles zero safely.
37

How do you run a DAX query in DAX Studio to test a measure?

Save to ▾
Show answer
EVALUATE SUMMARIZECOLUMNS( 'Date'[Fiscal Year], 'Product'[Category], "Sales", [Total Sales], "Margin", [Margin %] ) ORDER BY 'Date'[Fiscal Year] Turn on Server Timings and Clear cache before running to see storage engine and formula engine time. The same EVALUATE syntax works in the DAX query view in Desktop.
38

Split a datetime column to reduce cardinality in Power Query.

Save to ▾
Show answer
= Table.AddColumn(Source, "OrderDateOnly", each DateTime.Date([OrderDateTime]), type date) = Table.AddColumn(Prev, "OrderHour", each Time.Hour([OrderDateTime]), Int64.Type) Then remove the original OrderDateTime column. A datetime with seconds can have millions of unique values, while date and hour columns have only thousands and 24 values, compressing much better.
39

How do you use Git integration with a Power BI workspace?

Save to ▾
Show answer
Save the report as a Power BI Project (PBIP), commit the folder to a Git repository in Azure DevOps or GitHub, and connect a Fabric workspace to a branch through Workspace settings, Git integration. Changes can then be committed from the workspace or synced from the repository. Developers work on feature branches and merge through pull requests, giving history, reviews and rollback for reports and models.
40

How do you handle errors in Power Query without failing the whole refresh?

Save to ▾
Show answer
Use Keep Errors on a copy of the query to inspect the bad rows, then fix the cause, such as wrong data types or invalid dates. Replace Errors can substitute a value, and in M try ... otherwise catches errors per value: = Table.AddColumn(Source, "AmountNum", each try Number.From([Amount]) otherwise null, type nullable number) Log error rows to a separate query so they can be reviewed rather than silently dropped.
41

How do you design a KPI card that shows value, target and variance?

Save to ▾
Show answer
Use the new Card visual or a KPI visual with a main measure such as Total Sales, a target measure and a variance percent measure. Add conditional formatting so the variance turns red below target and green above it, and include a small trend if space allows. Keep labels short, such as Sales vs Target, and show the comparison period in the subtitle.
42

Write a measure to calculate a closing balance that is not summed across months.

Save to ▾
Show answer
Closing Balance = CALCULATE( SUM(Inventory[Qty]), LASTNONBLANK('Date'[Date], CALCULATE(COUNTROWS(Inventory))) ) Balances are semi-additive: they sum across warehouses but not across time. This takes the last date with data in each period. LASTDATE works when balances exist for every day.
43

How do you set up an app with different audiences?

Save to ▾
Show answer
In the workspace choose Create app or Update app, add the reports and dashboards, then in the Audience tab create audiences such as Sales Managers and Finance, choose which content each audience sees and grant access to the right Entra ID security groups. Publish the app and share the link. Remember RLS still controls rows inside reports; audiences only control which items are visible.
44

Describe how you would review another developer's Power BI model before release.

Save to ▾
Show answer
I check the model diagram for a clean star schema and single-direction relationships, run Best Practice Analyzer, and review VertiPaq Analyzer for oversized columns. I read key measures for correctness and naming, check that keys are hidden and formats set, test RLS roles, and run Performance Analyzer on main pages. I share findings as a short prioritised list, explaining why each change matters.

Frequently asked questions

Why are practical questions important?

Most technical rounds include at least one live task. Practising the exact typing and reasoning makes you calm and fast in the real round.

How should I answer them?

Talk while you work: say your approach first, write the simplest correct version, then improve it and mention edge cases.