Introduction
These Data Analyst Interview Questions of SQL & Power BI will be the master key to crack any data analyst interview. Data analyst profile is going at peal because demand for data analysts is going to grow as companies dependency is increasing on decisions based on data. During the hiring process, companies assign considerable importance on a candidate’s ability to use Power BI for analysis and visualizing and SQL for data extraction. As a result, queries regarding SQL, Power BI, and real-world problem-solving skills for data analysts are given special attention in most interviews.
This article’s comprehensive list of data analyst interview questions covers SQL, Power BI, scenarios, and best practices. Both newcomers and seasoned professionals preparing for technical interviews can use it.
This list of ultimate data analyst interview question is going to be a help you to compete in any interview of data analyst.
What Does a Data Analyst Do?
The duty of a data analyst is transforming unprocessed data into useful business insights falls to a data analyst. Common responsibilities include of:
- Using SQL for data extraction and manipulation
- Data transformation and cleaning
- Using Power BI to create dashboards and reports
- Recognizing patterns and trends, Providing stakeholders with insights
Interviewers evaluate candidates’ communication and business acumen in addition to their technical proficiency. these data analyst interview question all fields to crack the interview.
Data Analyst Interview Questions – SQL
SQL Interview Questions
Q 1. What is the difference between INNER JOIN and LEFT JOIN?
Ans.
- INNER JOIN returns only matching rows from both tables.
- LEFT JOIN returns all rows from the left table and matching rows from the right table; unmatched right rows return NULL.
Q 2. How do you find the second highest salary in a table?
Ans.
SELECT MAX(salary) AS second_highest
FROM employees
WHERE salary < (SELECT MAX(salary) FROM employees);
Q 3. What is the difference between WHERE and HAVING?
Ans.
- WHERE filters rows before aggregation.
- HAVING filters aggregated results after GROUP BY.
Q 4. How to find duplicate records in SQL?
Ans.
SELECT column_name, COUNT(*)
FROM table_name
GROUP BY column_name
HAVING COUNT(*) > 1;
Q 5. Write a query to get top 5 customers by sales.
Ans.
SELECT customer_id, SUM(sales) AS total_sales
FROM orders
GROUP BY customer_id
ORDER BY total_sales DESC
LIMIT 5;
Q 6. Explain RANK() vs DENSE_RANK().
Ans.
- RANK() leaves gaps in ranking when there are ties.
- DENSE_RANK() gives consecutive ranks without gaps.
Q 7. How do you handle NULL values in SQL?
Ans.
Use functions like COALESCE() or ISNULL() to replace NULL with default values.
Q 8. Write a query to calculate running total of sales.
Ans.
SELECT order_date, sales,
SUM(sales) OVER (ORDER BY order_date) AS running_total
FROM orders;
Q 9. What is the difference between UNION and UNION ALL?
Ans.
- UNION removes duplicates.
- UNION ALL keeps duplicates.
Q 10. How to find customers who didn’t place any order?
Ans.
SELECT c.customer_id, c.customer_name
FROM customers c
LEFT JOIN orders o ON c.customer_id = o.customer_id
WHERE o.customer_id IS NULL;
Q 11. Explain the purpose of indexes in SQL.
Ans.
Indexes speed up data retrieval by reducing the number of rows scanned.
Q 12. Write a query to get monthly sales for 2024.
Ans.
SELECT MONTH(order_date) AS month, SUM(sales) AS total_sales
FROM orders
WHERE YEAR(order_date) = 2024
GROUP BY MONTH(order_date)
ORDER BY month;
Q 13. What is the difference between TRUNCATE and DELETE?
Ans.
- DELETE removes rows but logs each transaction and can have a WHERE clause.
- TRUNCATE removes all rows without logging each row and resets identity.
Q 14. How to find the percentage contribution of each category to total sales?
Ans.
SELECT category,
SUM(sales) AS category_sales,
(SUM(sales) * 100.0 / SUM(SUM(sales)) OVER()) AS percentage_contribution
FROM orders
GROUP BY category;
Q 15. Explain CTE and when to use it.
Ans.
CTE (Common Table Expression) is a temporary result set defined using WITH for better readability and reusability in complex queries.
Power BI – 15 Questions
Q 16. What is the difference between calculated column and measure in Power BI?
Ans.
- Calculated column is stored in the model and computed row-by-row.
- Measure is calculated on the fly based on filter context.
Q 17. How do you handle data refresh in Power BI?
Ans.
- Schedule refresh in Power BI Service.
- Ensure gateway is configured for on-premises sources.
Q 18. Explain Row-Level Security (RLS) in Power BI.
Ans.
RLS restricts data visibility based on filters defined in roles, so users only see authorized data.
Q 19. What is the difference between Import and DirectQuery mode?
Ans.
- Import stores data in Power BI for faster performance.
- DirectQuery queries the source directly, useful for large datasets.
Q 20. How to create year-to-date (YTD) sales in DAX?
Ans.
YTD Sales =
TOTALYTD(SUM(Orders[Sales]), ‘Orders'[Order Date])
Q 21. How do you improve Power BI dashboard performance?
Ans.
- Reduce columns and rows in data model.
- Use measures instead of calculated columns where possible.
- Apply aggregations and query folding.
Q 22. Explain relationship cardinality in Power BI.
Ans.
One-to-One (1:1), One-to-Many (1:*), and Many-to-Many (:) define how tables relate.
Q 23. How to create a previous year sales comparison in Power BI?
Ans.
Previous Year Sales =
CALCULATE(SUM(Orders[Sales]), SAMEPERIODLASTYEAR(‘Orders'[Order Date]))
Q 24. What is a Star Schema in Power BI?
Ans.
A data model design with one fact table linked to multiple dimension tables, improving query performance.
Q 25. How do you use Bookmarks in Power BI?
Ans.
Bookmarks capture a report’s current state, allowing toggling between views for storytelling or navigation.
Q 26. How to create a Top 5 products by sales measure in DAX?
Ans.
Top 5 Products Sales =
TOPN(5, SUMMARIZE(Products, Products[Product Name], “Sales”, SUM(Orders[Sales])), [Sales], DESC)
Q 27. What is Query Folding in Power BI?
Ans.
Query Folding pushes transformations back to the data source, reducing load time and improving performance.
Q 28. How to create a Profit Margin % in Power BI?
Ans.
Profit Margin % =
DIVIDE(SUM(Orders[Profit]), SUM(Orders[Sales]), 0)
Q 29. How do you publish and share a Power BI report securely?
Ans.
- Publish to Power BI Service.
- Share via workspaces, apps, or RLS-based sharing.
Q 30. How do you handle different time zones in Power BI reports?
Ans.
- Convert UTC to local time in Power Query using
DateTimeZone.SwitchZone.
Learn more about PowerBI Click Here.
Conclusion
Preparing for data analyst interview questions requires a solid understanding of SQL, Power BI, and business problem-solving. With consistent practice, real-world projects, and clear communication, candidates can significantly improve their chances of success in Data Analyst interviews.
Check complete data analyst roadmap click here.

