Power BI is a highly in-demand skill in the field of data analytics. With this tool, you can interpret large datasets and create insightful reports which can be helpful in making wise decisions for any organization. Here is the list of questions with real scenarios. If you prepare all these questions definitely you will be able to grab a job in data analytics.
73 Power BI Interview Questions and with Answers for 2025
Q1. How would you manage and optimize the power BI report required to handle large data sets?
Ans. Use direct query mode if real-time data is needed
Use dataflows for preprocessing data.
Use incremental refresh instead of schedule refresh.
Limit the visuals and avoid cardinality.
Q2. What step would you take if a scheduled refresh fails in Power BI?
Ans.
Check for error messages.
Check the data source connection.
Verify gateway configuration.
Optimize queries and data models.
Check data size and service limit.
Update queries in dataflows if required.
Q3. What is the role of power bI paginated reports and when are they used?
Ans. A paginated report is required for pixel-perfect. It is mostly required for Business operations or for meeting purposes to get a clear print.
Q4. Difference between calculated column and measure.
Ans. Calculated columns are added columns in the table by performing aggregation on row by row and the result is stored in the model which increases the model size. Measures are calculated dynamically and not stored in the model.
Q5. Explain the difference between calculated columns and measures.
Ans:- Calculated Columns vs. Measures
A calculated column is a column added to a table, computed row by row, while a measure is a formula applied to a set of data, providing a dynamic calculation based on the context.
Q6. What is row-level security and how to implement it?
Ans. Row-level security restricts access for users. Users can see the data for which he is authorized. We can create row-level security in the modeling tab by managing roles. It is important to maintain sensitive information for certain users.
Q7. Explain power bi Gateway and its role.
Ans. Power BI gateway is a tool to connect the power BI to an on-premise data source. It works like a bridge, allowing you to keep the dashboard up-to-date without moving data to the cloud. There are two types of gateway.
- Standard Mode: useful for organizations to share access to multiple users. It supports power bi Automate, Power App, and Azure logical apps.
- Personal Mode: ideal for individual users.
Q8. How does a Power BI desktop differ from a Power BI service?
Ans. Power BI desktop is used for data modeling, report creation, and data visualization and is free for installation while Power BI services are cloud-based platforms meant for publishing, sharing, scheduling refresh, and viewing reports.
Q9. Explain the difference between power query and power pivot.
Ans. Power query is meant for data extraction, transformation, and loading of the data using the power query editor tool. Works on raw data for transformation and uses M language, required to clean, merge, and reshape the data.
Power Pivot – works on data that is already imported into the data model, using DAX for calculations, creating relationships, and performing analytics on the prepared data.
Q10. Explain the datasets in Power BI.
Ans. A dataset is the group of data that you import into the Power BI and then create the reports. You can connect Power BI with different data sources like Excel, CSV, and spreadsheets and with cloud services.
Q11. What is data refresh in Power BI?
Ans. Data refresh is the process of updating the dataset within the Power BI service, useful for getting the current and accurate report.
Types of Data Refresh in Power BI.
- On-Demand Refresh: Initiated by the users from the Power BI service. Ideal for immediate updates when an immediate refresh is needed.
- Scheduled Refresh: Automatically update the datasets at predefined intervals. Allow up to 8 refreshes per day for Power BI Pro and it’s 48 for Power BI premium.
- Live / Direct Query Connection: Creates a live connection to the data source, fetches the latest data on demand and eliminates the need for scheduled refresh.
- Dataflow Refresh: Refresh the data stored in Power BI Dataflows to keep it in sync with the source.
- Cached Refresh: Applies to the dashboard and tiles connected directly to the data source. It updates the visuals and tiles and shows the most updated information.
When working on Power BI it’s important to have proper credentials for authentication to access the data source. Proper gateway configuration is highly required for on-premise data sources because large datasets take a long time to refresh, it’s crucial to optimize queries and model design for improved performance.
Q12. What are the types of relationships in Power BI?
Ans. In Power BI relationships are important for data modeling, using effective data analysis and data visualization. There are various types of relationships.
- One-to-Many (1:*): where a single row in the parent table relates to many rows in the child table.Example:
- A Customers table (1) is linked to an Orders table (*).
Use Case: When you have a fact table and a dimension table.
- Many-to-one (*:1): Many rows in the child table relate to one row in the parent table.
Example:
- Orders table (*) is linked to a Products table (1).
- Many-to-Many (:): Multiple rows of one table relate to multiple rows of another table.
Example:
- Students () enrolled in multiple Courses ().
Use Case: Complex relationships such as those between transactions and multiple accounts.
- One to One (1:1):
A single Row relates to one row with another table.
Q13. How to Define Relationships in Power BI?
Automatic Detection:
Power BI detects and creates relationships based on matching column names and data types.
Manual Creation:
Go to Model View → Drag and drop fields between tables to create relationships.
Define the relationship type and cardinality.
Editing Relationships:
Adjust relationship properties such as cardinality, and cross-filter direction, or make the relationship active/inactive.
Q14. Explain different query modes in power BI
Ans.
Import Mode
Data is imported and stored in Power BI memory. It gives fast performance because data is processed in Power BI’s memory.
Use Case: Suitable for static or moderately changing data, and scenarios requiring complex transformations and aggregations.
Example: Importing a CSV file or SQL database for daily sales reports.
Direct Query Mode
Data is accessed directly from the source without being stored in Power BI. Offers real-time data access, reflecting changes immediately in visuals; and supports large datasets. Slower performance compared to Import Mode; limited transformations; restrictions on aggregations or calculations.
Use Case: Ideal for real-time reporting or dashboards, and when data security prevents data import.
Example: Monitoring live stock prices or sales data.
Composite Mode (Hybrid)
It is the mixture of Import Mode and DirectQuery in the same dataset.
Provide Flexibility to use Import Mode for frequently accessed data and DirectQuery for live updates; optimized for hybrid scenarios. Complexity in managing relationships and queries; requires careful modeling.
Use Case: Suitable for scenarios requiring both historical and real-time data; efficient for large datasets.
- Example: Combining historical sales data (imported) with real-time inventory data (DirectQuery).
Live Connection
Similar to DirectQuery but for live connections with Analysis Services (e.g., SSAS Tabular). No local data model in Power BI; managed at the source; real-time data updates data modeling or transformations in Power BI; dependent on source performance.
Example: for enterprise reporting purposes Connecting to Azure Analysis Services.
Push Dataset
Data is pushed into Power BI Service using APIs.
Supports real-time streaming of data; used for dashboards requiring near-instant updates.Limited to dashboards; not suitable for complex analysis.
- Use Case: Perfect for IoT dashboards or systems monitoring in real-time.
Example: Monitoring device temperatures from IoT sensors.
Q15. Explains different keys in Power Bi
Ans. Keys Are very important in power BI to maintain the relationships. There are different keys in Power BI.
Primary Key
A unique identifier assigned for each row in a table. Like there will be a unique customer ID in the customer table which will be used as the main reference to create relationships with other tables.
Foreign Key
A column of one table that behaves as the primary key for another table.
It joins two tables together, enabling data integration for comprehensive reporting and analysis.
Example: ProductID in a Sales table, which corresponds to ProductID in a Products table. Crucial for creating relationships in Power BI’s data model, allowing seamless data combination from different tables.
Composite Key
It is also a unique identifier that is formed by joining two or more columns. It provides uniqueness if there is no single column acting as a primary key.
Like OrderID and ProductID together form a composite key in an OrderDetails table.
Surrogate Key
It is generated artificially through the system for unique rows. It works like a substitute for the natural key if they are not present. It simplifies relationships in star or snow schema models.
Q16. Explain the concept of bidirectional filtering relationship in Power BI.
Ans. The bidirectional relationship is used to filter the data in both directions across the relationship in both tables. Like many to many relationship data need to filter in both directions.
For example, many students can enroll in many courses. It can slow the performance so we should use it when required.
We can configure bidirectional filtering in the model view by setting cross-filter direction on both sides.
Q17. Explain the difference between Calculate and Calculetable.
Ans. These are DAX functions used to modify filter context but there is a difference in their output.
CALCULATE – It checks the expression and returns a single value.
Use case
- Performing aggregations like sums, averages, or variances.
- While creating time intelligence calculations when we do year-on-year comparisons.
- Apply filters to modify the context of a measure
- Syntax of Calculate CALCULATE(<Expression>, <Filter1>, <Filter2>, …)
DAX Sales in West = CALCULATE(SUM(Sales[Amount]), Sales[Region] = “West”)
Dax to calculate total sales for the west region.
CALCULATETABLE – It evaluates the table expression in a modified filter and returns the table as output.
Syntax: CALCULATETABLE(<Table>, <Filter1>, <Filter2>, …)
FilteredSales = CALCULATETABLE(
Sales, Sales[Region] = “West”, Sales[Amount] > 500)
DAX to create the sales table for the west region.
Q18. Explain related and relatable functions and how to use them.
Ans .. Related function is used to retrieve a single value from the related table based on one-to-one and one-to-many relationships.
Syntax: RELATED(<Column>)
ProductName = RELATED(Products[ProductName])
ProductName = RELATED(Products[ProductName])
- In the Sales table, this pulls the ProductName based on the ProductID.
Related table Function – Related table function returns the table of values from related tables based on one-to-many or many-to-many relationships. It takes table names as arguments and returns a table containing all rows from the related table that are related to the current row.
Syntax: RELATED TABLE(<Table>)
SalesForProduct = COUNTROWS(RELATED TABLE(Sales))
- In the Products table, this counts all related sales for each product.
Q19. Explain the difference between power BI dataflows and datasets.
Ans. Dataflows- Dataflows are cloud-based reusable data transformations and store the data in Azure data lake storage following the ETL process. Dataflow connects to various data sources, cleanses the data, performs transformations using power query, and prepares the data for reporting purposes.
Datasets – Datasets are collections of data that are loaded in Power BI, processed, and used for data analytics reports and visualization. Datasets are stored in Power BI’s in-memory engine.
Q20. What is incremental refresh in Power BI?
Ans. Incremental refresh we applied when we need to update the new or changed records. We can save time by avoiding the loading of full data in Power BI. Incremental refresh helps us to optimize the refresh process for large datasets. Through incremental refresh, we can save time as well as improve performance. For example, suppose you have the
sales data of the last 8 years and you have to update the last month’s data, In this scenario you will go for incremental refresh
Steps for incremental refresh
1. Define Parameters:
- Go to Power BI Desktop.
- Open Transform Data → Manage Parameters → New Parameter.
- Create:
- RangeStart: The start date for an incremental refresh.
- RangeEnd: End date for incremental refresh.
- Set default values (e.g., dates).
- 2. Apply Parameters:
In Power Query Editor, filter data using these parameters:
PowerQuery
Table.SelectRows(#”PreviousStep”, each [SalesDate] >= RangeStart and [SalesDate] < RangeEnd)
- This loads only data within the date range.
3. Publish to Power BI Service:
- Save and close Power Query Editor.
- Go to the Modeling tab → Enable Incremental Refresh:
- Right-click the table → Incremental Refresh.
- Set the refresh policy:
- Store data: Specify historical data retention (e.g., last 8 years).
- Refresh data: Specify recent data refresh period (e.g., last 1 month).
4. Configure in Power BI Service:
- Publish the dataset to a workspace.
- In the workspace, select the dataset and set up a refresh schedule.
- Enable Scheduled Refresh for automatic updates.
Q21. Explain the difference between append and merge query.
Ans. Append query – you can perform transformation through append and merge query.
In the append query, you can append rows from one table to another and make a single table. You can select the append query when both the tables have the same column name and data types.
Merge query – You can opt for Merge query when you need to add additional details. You can perform a merge on the basis of key columns by joining operations. Suppose you have two tables Sales and product table and product_ID is the key column. If you want to fetch product details in the sales table then you can perform merge operations.
Merge types are
- Inner Join: Returns only matching rows from both tables.
- Left Outer Join: Returns all rows from the left table and matching rows from the right table.
- Right Outer Join: Returns all rows from the right table and matching rows from the left table.
- Full Outer Join: Returns all rows from both tables.
- Anti Joins (Left/Right): Returns rows from one table that have no match in the other.
Q22. How would you create relationships between different tables in Power BI?
Ans. Follow these steps to create relationships between the different tables
- Find matching Columns: Locate the columns which make connections between the two tables. These columns should contain matching data types and represent the same entity.
- Open the Relationship View: In Power BI Desktop, go to the “Modeling” tab and select “Manage Relationships.”
- Create a New Relationship: Click the “New Relationship” button.
- Select Tables: Choose the two tables that you want to relate.
Define the Relationship:
- Select the Primary Table: Choose the table that will be the “one” side of the relationship.
- Select the Related Table: Choose the table that will be the “many” side of the relationship.
- Select Related Columns: Choose the common columns from each table.
- Set the Relationship Type: By default, Power BI will automatically determine the relationship type (one-to-many or many-to-many). You can adjust this if needed.
- Apply the Relationship: Click “Create” to establish the relationship between the two tables.
Q23. How do you manage user roles and permissions in Power BI?
Ans.
Managing User Roles and Permissions in Power BI
Power BI offers robust mechanisms to control access to reports, datasets, and workspaces. Here’s a breakdown of how you can manage user roles and permissions:
Workspace Roles:
- Admin: Full control over the workspace, including managing members, sharing content, and deleting items.
- Member: Can view, edit, and share content within the workspace.
- Contributor: Can view and edit content but cannot share it.
- Viewer: Can only view content within the workspace.
Assigning Roles to Users:
- Navigate to the Workspace: Go to the desired workspace in the Power BI service.
- Manage Permissions: Click on the “More options” button (three dots) and select “Manage permissions.”
- Add Users: Add users or groups by entering their email addresses.
- Assign Roles: Assign the appropriate role to each user or group.
Row-Level Security (RLS):
RLS allows you to control which data users can see based on their roles or permissions. To implement RLS:
- Define Roles: Create roles in Power BI Desktop and assign filters to each role.
- Apply Filters: Use DAX expressions to filter data based on user attributes.
- Assign Users to Roles: Assign users to roles in the Power BI service.
Q24. How does Power BI handle real-time data streaming, and what are its use cases?
Ans.
Power BI and Real-Time Data Streaming
While Power BI traditionally has been a tool for analyzing historical data, it has evolved to support real-time data streaming, enabling you to visualize and react to data as it happens.
Key Methods for Real-Time Data Streaming in Power BI:
- Power BI Streaming Datasets:
You can directly stream data into Power BI using the “Streaming Dataset” feature.
- Power BI can process and visualize this incoming data in real time.
- Stock tickers, sensor data, IoT device data, and real-time sales figures.
2. Azure Stream Analytics and Power BI:
- Stream Processing: Azure Stream Analytics can process real-time streams of data from various sources (IoT devices, sensors, etc.).
- Data Transformation and Filtering: It can transform and filter the data based on specific conditions.
- Integration with Power BI: The processed data can then be pushed to Power BI for visualization.
Use Cases for Real-Time Data Streaming in Power BI:
- · Tracking performance by KPI and metrics in real-time to make timely business decisions.
Q25. What is the significance of the “Drillthrough” feature in Power BI?
Ans.
Drill-through is a powerful feature in Power BI that allows users to explore data at a more granular level. When you drill through a visualization, you can access more detailed information about the selected data point.
Significance of Drill-through:
- Enhanced Data Exploration: Drill-through empowers users to delve deeper into the data and uncover hidden insights.
- Improved Decision-Making: By understanding the underlying details, users can make more informed decisions.
- Increased User Engagement: Interactive visualizations encourage users to explore the data and gain valuable insights.
How to Implement Drill-through:
1 Create a Detailed Report Page: Design a report page that displays the detailed information you want to show when drilling through.
2. Set Up the Drill-through Action:
- Select the visualization you want to enable drill-through for.
- In the Visualizations pane, go to the “Format” section and find the “Drillthrough” option.
- Enable drill-through and select the target report page.
3. Configure Drill-through Behavior:
- You can customize the drill-through behavior to filter the target report based on the selected data point.
- Use DAX functions like SELECTEDVALUE and FILTER to dynamically filter the data in the target report.
Example:
If you have a bar chart showing sales by product category, you can enable drill-through to a detailed report that shows the sales for each product within a specific category. When you click on a bar in the chart, the drill-through action will take you to the detailed report, filtered to the selected category.
Storing: Monitor real-time sensor data from IoT devices.
- Financial Dashboards: Track stock prices, market trends, and trading activity.
- Customer Analytics: Analyze customer behavior in real-time to improve customer experience.
- Operational Dashboards: Monitor key performance indicators (KPIs) and operational metrics.
Q26. How do you use bookmarks in Power BI to enhance report interactivity in Power BI?
Ans.
Bookmarks in Power BI are a powerful tool to save specific filter and visualization states. They allow users to quickly switch between different views of the data, making it easier to explore and analyze information.
How to Create and Use Bookmarks:
- Create a Bookmark:
- Select the Desired State: Filter, sort, and highlight the specific view of the data you want to bookmark.
- Create Bookmark: Go to the “View” tab and select “Bookmarks” -> “Add Bookmark.”
- Name the Bookmark: Give the bookmark a descriptive name.
2. Use the Bookmark:
- Apply the Bookmark: Click on the bookmark to instantly apply the saved filter and visualization settings.
- Combine Bookmarks: Use bookmarks in conjunction with slicers and filters to create dynamic views of the data.
Q27. How you will combine multiple tables from different data sources (e.g., SQL and Excel). What approach would you take in Power BI?
Ans.
- Load the tables into Power Query.
- Check column names and data types match.
- Use Merge Queries or Append Queries in Power Query to combine the tables.
- Perform data transformation to maintain uniformity.
Q28. How do you create and manage data alerts in Power BI?
Ans. Creating and Managing Data Alerts in Power BI
Data alerts in Power BI allow you to be notified when a specific metric reaches a certain threshold or deviates from a trend. This feature is essential for proactive monitoring and timely decision-making. Here’s how you can create and manage data alerts in Power BI:
1. Setting Up Data Alerts:
- Select the Visual: Choose the visual (card, gauge, or KPI) for which you want to set up an alert.
- Access Alert Settings: Click the ellipsis (…) on the visual and select “Manage Alerts.”
- Create a New Alert: Click the “+ Add alert rule.”
4. Define the Alert:
- Title: Give your alert a descriptive name.
- Condition: Set a condition, such as “Value is greater than X,” “Value is less than X,” or “Value changes by X%.”
- Threshold: Specify the threshold value for the alert.
- Frequency: Choose how often you want to receive notifications (e.g., daily, weekly).
- Notification Method: Select the desired notification method (email or Teams).
2. Managing Data Alerts:
- Edit Alerts: Modify the alert’s title, condition, threshold, or notification settings.
- Disable Alerts: Temporarily disable alerts without deleting them.
- Delete Alerts: Remove unnecessary alerts.
Q29. RELATED vs. LOOKUPVALUE:
Ans. RELATED Function:
The RELATED function is used to fetch a single value from a related table and it uses an existing relationship between tables. This function requires that there is a predefined relationship in the data model.
The syntax is RELATED(column_name).
For example
CustomerName = RELATED(Customers[CustomerName]), where it retrieves the customer name from the “Customers” table based on the relationship.
LOOKUPVALUE Function:
LOOKUPVALUE function can retrieve a value from a table based on one or more search columns, even if there is no predefined relationship. This function is more versatile, allowing for complex scenarios and multiple criteria. The syntax is LOOKUPVALUE(result_columnName, search_columnName1, search_value1, [search_columnName2, search_value2], … [, alternateResult]).
For example
ProductCategory = LOOKUPVALUE(Products[ProductCategory], Products[ProductID], Sales[ProductID]), which fetches the product category from the “Products” table by matching the ProductID in the “Sales” table.
Q30. If you face an error during the refresh. Even if you provide the SQL server name but not get resolved. What steps will you take?
Ans.
First, I will check the server name and the credentials in the data source setting.
Second, will the network connect to the SQL server?
Third, check the gateway configuration.
Q31. How do you handle many-to-many relationships in Power BI?
Ans to many relationships can be handled by using a bridging table.
What is a Bridging Table?
A bridging table is an intermediary table through which we connect two tables with a many-to-many relationship. It essentially creates a one-to-many relationship between each of the original tables and the bridging table.
How to Implement a Bridging Table:
- 1. Identify the Many-to-Many Relationship:
- Determine which two tables have a many-to-many relationship.
- For example, a “Products” table and a “Categories” table might have a many-to-many relationship if a product can belong to multiple categories and a category can contain multiple products.
2. Create the Bridging Table:
- Create a new table to act as the bridge.
- Add columns to this table to reference the primary keys of the two main tables.
- Populate the bridging table with the appropriate combinations of values.
3. Establish Relationships:
- Create a one-to-many relationship between the bridging table and each of the main tables.
Example:
Consider a scenario where products can belong to multiple categories.
Original Tables:
- Products: ProductID, ProductName
- Categories: CategoryID, CategoryName
Bridging Table:
- ProductCategories: ProductID, CategoryID
Relationships:
- Products (one-to-many) ProductCategories (many-to-one)
- Categories (one-to-many) ProductCategories (many-to-one)
Q32. What will be preferred, slicer or filters? According to you, which is good to use?
Ans:-
Slicers vs. Filters: A Comparative Analysis
Both slicers and filters are important to interact and filter in data visualization.
Slicers:
- Slicers are visible on the report canvas. Users can interact with slicers to filter the data.
Filters:
Filters are applied behind the scenes and are not visible to users. Filters can be applied to a particular visual or entire report.
- Filters can be used for more complex filtering scenarios, such as conditional filtering and advanced DAX expressions.
When to Use Slicers/Filter
Use slicers when you want to provide a simple and interactive way for users to filter data.
Use filters when you need to apply more complex filtering logic or when you want to control which filters are visible to users.
Q33. You have to combine multiple tables from various data sources like Excel, SQL server, and datasets from previous projects. How you will do it?
Ans:-
Understanding the Data Sources
- Excel Sheet:
Through the “Get Data” option Power BI desktop imports the data from Excel.
- SQL Server:
By passing proper credentials connect to the SQL server and import the data into Power BI
Previous Project Dataset:
- If the dataset is in a .pbix file, import it straight into Power BI Desktop.
- Use tools like Power BI Desktop or SQL Server Integration Services (SSIS) to extract the needed tables and data from the .pbix file.
Combining Data
You can combine the data through the Merge query and Append query and then make a data model by forming a relationship between tables.
Q34. What is the distinction between DirectQuery and Live Connection in Power BI? How do these connectivity options affect data retrieval and report performance?
Ans.
DirectQuery vs. Live Connection in Power BI
DirectQuery and Live Connection are two basic methods for connecting Power BI to external data sources.
DirectQuery:
- Data is retrieved directly through the queried data source (e.g., SQL Server, Azure SQL Database) for each user interaction. Doesn’t store data locally in Power BI and is always up to date with the latest data. With the help of Direct query can handle large datasets. However, it is slow in performance for complex queries. As compared to import mode it has limited data modeling.
Live Connection:
Data Access: Establishes a direct connection to a semantic model (such as Analysis Services or a Power BI dataset). Does not store data locally in Power BI. It is faster than the direct query.
Q35. You have two tables, one is the transactions table and the other is the Customer table. How will you create a data model to analyze customer transaction behavior?
Ans.Two tables:
- Transactions Contains transaction data.
- Customers Contains customer information.
Creating a data model in Power BI to analyze customer transaction behavior.
Steps to Create the Data Model
- Load Data:
Import the Transactions and Customers tables into Power BI.
- Create Relationships:
Make sure there is a key in each table to establish a relationship:
- Transactions table: TransactionID, CustomerID, TransactionAmount, TransactionDate.
- Customers table: CustomerID, CustomerName, CustomerSegment.
- Establish a relationship between Transactions[CustomerID] and Customers[CustomerID] (many-to-one relationship).
- Create Calculated Columns and Measures:
- Add calculated columns or measures to derive insights, such as:
- Total Transactions: TotalTransactions = COUNT(Transactions[TransactionID])
- Total Transaction Amount: TotalTransactionAmount = SUM(Transactions[TransactionAmount])
- Add calculated columns or measures to derive insights, such as:
- Build the Report:
- Use the defined measures and relationships to create visualizations:
- Customer Segmentation Analysis: Group customers by segments and visualize their transaction behavior.
- Transaction Trends: Analyze transaction trends over time (e.g., daily, monthly).
- Top Spending Customers: Identify customers with the highest transaction amounts.
- Use the defined measures and relationships to create visualizations:
Example Data Model
Customers Table CustomerID, CustomerName, CustomerSegment
Transactions Table TransactionID, TransactionAmount, TransactionDate
Visuals to Include:
- Bar Chart: Customer segments vs. total transaction amount.
- Line Chart: Transaction trends over time.
- Table: Top spending customers with their transaction amounts.
Q36. Your Power BI report needs to display data only for the last 12 months, but the source table contains historical data for 5 years. How would you optimize data loading?
Ans.
Use Power Query to filter data by adding a condition on the date column:
Power
Copy code
Date >= Date.AddMonths(DateTime.LocalNow(), -12)
- If connected to a database, use a custom SQL query or query folding to filter data at the source.
Q37. Can you explain the difference between SUMX and SUM in DAX?
Ans:- SUM vs. SUMX: A Key Difference
We use SUM and SUMX to perform aggregation in DAX both are different
SUM:
For simple aggregation use SUM as it sums up the values from a single column. It does direct calculations don’t iterate over rows
- Syntax: SUM(<column_name>)
Example:
Code snippet
TotalSales = SUM(Sales[SalesAmount])
This will sum up all the values in the SalesAmount column.
SUMX:
We use SUMX for customizing aggregations. It iterates and performs calculations row by row and then sums up all the individual results.
- Syntax: SUMX(<table>, <expression>)
Example:
Code snippet
TotalSalesByProduct = SUMX(
Sales,
Sales[SalesAmount] * (1 – Sales[Discount])
)
Here, SUMX iterates over each row in the Sales table, calculates the discounted sales amount for each row, and then sums up these values.
Q38. What is a dimension table, and how does it relate to fact tables in Power BI data modeling?
Ans. Dimension Tables vs. Fact Tables
A good data model is essential for effective data visualization and data analysis. It can be well structured if you understand the difference between a dimension table and a fact table.
Dimension Tables:
Dimension tables have descriptive attributes about fact. Columns provide dimensions like product name, region, and category. The dimension table gives a description of the fact table.
Fact Tables:
Contains numerical data which have to be analyzed. Make relationships and connect with dimension tables through foreign keys. For example sales figures, inventory, and financial transactions.
DAX Related queries –
Here are some real scenarios on DAX which will be very helpful.
Q39. Calculate total sales for the current month.
Ans.
Monthly Sales = SUM(Sales[Amount])
Q40. Compare sales growth year over year in Power BI.
Ans.
YoY Sales Growth =
(SUM(Sales[Amount]) – CALCULATE(SUM(Sales[Amount]), SAMEPERIODLASTYEAR(Date[Date]))) /
CALCULATE(SUM(Sales[Amount]), SAMEPERIODLASTYEAR(Date[Date]))
Q41. How can you create a DAX formula to calculate the number of returning customers who made purchases in both the current month and the previous month using the given dataset?
Ans.
Returning Customers =
CONTROLS(
INTERSECT(
CALCULATETABLE(Sales, DATESINPERIOD(Date[Date], TODAY(), -1, MONTH)),
CALCULATETABLE(Sales, DATESINPERIOD(Date[Date], TODAY(), -2, MONTH))
)
)
Q42. Calculate the average time taken by employees to complete tasks.
Ans. Average Task Time = AVERAGE(Tasks[Completion Time (Hours)])
Q43. Rank employees based on the total number of tasks they have completed using a DAX formula?
Ans.
Rank by Tasks = RANKX(ALL(Employees), SUM(Tasks[Completed Tasks]), , DESC)
Q44. Identify products with inventory below a certain threshold.
Ans Low Stock =
IF(SUM(Inventory[Stock]) < 10, “Reorder”, “In Stock”)
Q45. Calculate the number of days the current stock will last based on average daily sales.
Ans – Stock Coverage = DIVIDE(SUM(Inventory[Stock]), AVERAGE(Sales[Daily Sales]))
Q46. Calculate the gross profit margin for each product or region.
Ans. Gross Profit Margin =
DIVIDE(SUM(Sales[Revenue]) – SUM(Sales[Cost]), SUM(Sales[Revenue]))
Q47. Display cumulative revenue over time.
Ans .Cumulative Revenue =
CALCULATE(SUM(Sales[Revenue]), FILTER(ALL(Date), Date[Date] <= MAX(Date[Date])))
Q48. Calculate the return on investment (ROI) for campaigns.
Ans Campaign ROI =
DIVIDE(SUM(Campaigns[Revenue Generated]) – SUM(Campaigns[Cost]), SUM(Campaigns[Cost]))
Q49. Measure the percentage of leads converted to customers
Ans Conversion Rate = DIVIDE(SUM(Leads[Converted Leads]), SUM(Leads[Total Leads]))
Q50. Create dynamic categories like “High Spender,” “Medium Spender,” and “Low Spender.”
Ans -Customer Segment =
SWITCH(
TRUE(),
SUM(Sales[Amount]) > 5000, “High Spender”,
SUM(Sales[Amount]) > 2000, “Medium Spender”,
“Low Spender”
)
Q51. Display sales for the previous month.
Ans Last Month Sales =
CALCULATE(SUM(Sales[Amount]), PREVIOUS MONTH(Date[Date]))
Q52. Calculate revenue from the beginning of the year to the current date.
Ans YTD Revenue =
TOTALYTD(SUM(Sales[Amount]), Date[Date])
Q53.Calculate the percentage of completed tasks for a project.
Ans Task Completion % =
DIVIDE(COUNTROWS(FILTER(Tasks, Tasks[Status] = “Completed”)), COUNTROWS(Tasks))
Q54. Identify tasks with deadlines that have passed and are not completed
Ans Overdue Tasks =
COUNTROWS(FILTER(Tasks, Tasks[Deadline] < TODAY() && Tasks[Status] <> “Completed”))
Q55. Calculate the discount percentage for each product.
Ans Discount % =
DIVIDE((Products[Original Price] – Products[Discounted Price]), Products[Original Price]) * 100
Q56. Calculate the potential revenue loss due to discounts
Ans Revenue Loss =
SUMX(Products, (Products[Original Price] – Products[Discounted Price]) * Products[Quantity Sold])
Q57. Calculate the bounce rate (percentage of single-page sessions).
Ans Bounce Rate =
DIVIDE(SUM(Sessions[Bounce Sessions]), SUM(Sessions[Total Sessions]))
Q58. Calculate the average time users spend on the website
Ans Avg Session Duration =
AVERAGE(Sessions[Session Duration (Minutes)])
Q59. Calculate the difference between budgeted and actual expenses.
Ans Budget Variance = SUM(Budget[Amount]) – SUM(Actuals[Amount])
Q60. Show the percentage variance
Ans Variance % =
DIVIDE(Budget Variance, SUM(Budget[Amount])) * 100
Q61. Convert sales figures to a selected currency using exchange rates.
Ans Converted Sales =
SUM(Sales[Amount]) * LOOKUPVALUE(ExchangeRates[Rate], ExchangeRates[Currency], SelectedCurrency[Currency])
Q62. Calculate the percentage of customers who canceled subscriptions
Ans Churn Rate =
DIVIDE(COUNTROWS(FILTER(Customers, Customers[Status] = “Churned”)), COUNTROWS(Customers))
Q63. Find active customers by month
Ans.
Active Customers =
CALCULATE(COUNTROWS(Customers), Customers[Status] = “Active”)
Q64. Measure the percentage of deliveries made on time.
Ans On-Time Delivery % =
DIVIDE(COUNTROWS(FILTER(Deliveries, Deliveries[Status] = “On Time”)), COUNTROWS(Deliveries))
Q65. Calculate the average time taken to deliver an order.
Ans. Avg Delivery Time =
AVERAGE(Deliveries[Delivery Time (Days)])
Q66. Calculate the profit for each product.
Ans. Profit Per Product = SUM(Sales[Revenue]) – SUM(Sales[Cost])
Q67. Show the profit margin percentage by region.
Ans. Profit Margin % =
DIVIDE(SUM(Sales[Revenue]) – SUM(Sales[Cost]), SUM(Sales[Revenue]))
Q68. Calculate the percentage of employees who left the company.
Ans. Attrition Rate =
DIVIDE(COUNTROWS(FILTER(Employees, Employees[Status] = “Left”)), COUNTROWS(Employees))
Q69. Display the number of employees still active.
Ans. Remaining Headcount =
CONTROLS(FILTER(Employees, Employees[Status] = “Active”))
Q70. Rank products based on total sales.
Ans. Rank by Sales =
RANKX(ALL(Products), SUM(Sales[Amount]), , DESC)
Q71. Rank by Profit Margin: Rank products by profit margin percentage.
Ans. Rank by Profit Margin =
RANKX(ALL(Products), [Profit Margin %], , DESC)
Q72. Group the customers depending on their purchase frequency.
Ans. Customer Frequency Group =
SWITCH(
TRUE(),
COUNT(Sales[Order ID]) >= 10, “Frequent Buyer”,
COUNT(Sales[Order ID]) >= 5, “Occasional Buyer”,
“Rare Buyer”
)
Q73. Forecast the revenue for the next month.
Ans. Forecast Revenue =
CALCULATE(
SUM(Sales[Revenue]),
DATEADD(Date[Date], 1, MONTH)
)
Conclusion
If you are preparing to enter into the data field, enrolling with Console Flare will be the best choice for you. Here you will be providing hands-on training that matches the industry standard, you will get a chance to work on real datasets with real scenarios which will make you capable of solving complex business problems and grabbing a high-paying job.
For more such content and regular updates, follow us on Facebook, Instagram, LinkedIn