2
2
ChatGPT said:
ChatGPT
In Power Query (part of Power BI), you can perform numerous transformations to clean and shape
your data for analysis. Here’s a breakdown of the most common transformation steps, which you
might be asked to explain in an interview:
Step: The first step is to connect to your data sources (Excel, CSV, SQL databases, Web, etc.).
Example: In Power Query, you can select “Get Data” and choose the data source.
Step: Power Query automatically assigns data types, but it’s important to review and change
them if necessary.
Example: Right-click on a column > Change Type > Select the appropriate type (e.g., Text,
Date, Number).
3. Rename Columns
Step: You might need to rename columns to make them more meaningful.
5. Filter Rows
Step: Use filtering to exclude rows that don't meet certain criteria (e.g., filtering by date,
value ranges, etc.).
Example: Click on the filter icon in a column header and specify the filtering condition.
6. Remove Duplicates
Example: Select a column (or multiple columns) > Right-click > Remove Duplicates.
7. Group By
Step: Aggregate data by grouping based on one or more columns (e.g., summing values for
each category).
Example: Select a column > Home tab > Group By > Specify the operation (sum, average,
etc.).
8. Merge Queries
Step: Combine data from different tables by merging them on a common column.
Example: Home tab > Merge Queries > Select the tables and columns to join on.
9. Append Queries
Example: Home tab > Append Queries > Select the tables you want to append.
Step: Pivoting turns rows into columns, and unpivoting turns columns into rows.
Example (Pivot): Select the column to aggregate > Transform tab > Pivot Column.
Example (Unpivot): Select the columns to unpivot > Transform tab > Unpivot Columns.
Step: Split one column into multiple columns based on a delimiter or character count.
Example: Select the column > Split Column > By Delimiter (e.g., comma, space).
Step: Add calculated columns based on custom formulas using M code (Power Query’s
formula language).
Example: Add Column > Custom Column > Write the formula.
Step: Replace specific values (e.g., replace nulls with 0 or replace misspelled text).
Example: Right-click on a cell > Replace Values > Specify the value to replace and the new
value.
Example: Add Column > Conditional Column > Specify the conditions.
Example: Filter out nulls or blanks by using the filter menu in the column.
Step: If you have a reusable function, you can invoke it in the query.
Step: Extract a portion of the data from text fields (e.g., extract the first few characters or a
substring).
Example: Transform > Extract > Extract First Characters / Text Between Delimiters.
Step: Access and modify the M code for your transformations. This is useful for applying
more complex logic that isn’t available through the UI.
Example: Manage Parameters > New Parameter > Use it in query filters or calculations.
Step: Once transformations are complete, you can refresh data to pull updated data from the
source.
Step: After all transformations, apply the changes to load data into Power BI.
These are some of the most common transformations you might encounter or be asked about in a
Power BI interview. Having a strong grasp of these will demonstrate your ability to manipulate and
prepare data for analysis.
Answer: Power BI Desktop is a free application that allows you to connect to, transform, and
visualize your data. Its main components include:
Report View: The area where you create and design reports using different visualizations.
Data View: The view for exploring and modeling your data tables.
Query Editor: This is used to clean and transform data before it’s loaded into the model.
Relationships Pane: It visually shows the relationships between the data tables.
Visualizations Pane: This allows you to choose and configure different types of visualizations.
Data Model Optimization: Reduce the size of the dataset by removing unnecessary columns
and rows, and optimize relationships with the appropriate cardinality and direction.
DAX Optimization: Use efficient DAX functions like SUMX, AVERAGEX, instead of more
complex, nested calculations. Minimize the use of CALCULATE when unnecessary.
Query Optimization: Ensure that Power Query transformations are applied efficiently,
leveraging native query folding when possible.
Limiting Visual Complexity: Reduce the number of visuals on a page, and ensure the visual
interactions are minimal.
DirectQuery vs. Import Mode: For large datasets, use DirectQuery where possible, but make
sure that the data source supports efficient querying.
3. What are bookmarks in Power BI, and how would you use them in a business dashboard?
Answer: Bookmarks capture the current state of a report page, including filters, slicers, and the state
of visuals. In a business dashboard:
Bookmarks can be used to create custom navigation experiences, allowing users to toggle
between different views of the data.
They are helpful for storytelling, allowing users to guide through different insights step by
step.
Bookmarks can be paired with buttons and selections to allow for dynamic, interactive
reports where users can switch between different report sections or views with ease.
Bookmarks also enable the creation of toggle switches (e.g., switching between charts or
tables) by hiding/unhiding visuals based on a bookmark state.
4. Explain the difference between calculated columns and measures in Power BI.
Answer:
Calculated Columns: These are created at the row level in your data model, and they are
stored as part of your model. Calculated columns add new data to your table and can be
used in slicers and visuals like any other column. They consume more storage as they are
materialized within the data model.
Measures: These are dynamic calculations performed on the fly and are not stored in the
model. Measures are more efficient for performance as they are calculated at the time of
rendering. They are ideal for aggregate values (e.g., sum, average) based on user interactions
and filters in the report.
5. What is DAX, and can you explain one of the most complex DAX functions you have used?
Answer: DAX (Data Analysis Expressions) is the formula language used in Power BI, Power Pivot, and
SSAS Tabular models. It is designed to work with relational data and perform aggregations and
calculations on that data.
One of the more complex DAX functions is CALCULATE. It allows you to modify the context in which a
calculation is performed. For example:
DAX
Copy code
In this case, CALCULATE modifies the filter context to only sum the sales amounts where the date
equals 2024.
Complexity Example: A scenario where you need to calculate Year-over-Year (YoY) growth:
DAX
Copy code
YoY Growth =
Answer: Relationships in Power BI are crucial for creating a unified model from different tables.
Here’s how you manage them:
Use the Model view to visually define relationships between tables, ensuring that you define
the correct cardinality (One-to-Many, Many-to-Many).
You can set the Cross-filter direction to either single or bi-directional depending on the
interaction you want between tables.
Make sure relationships are based on keys that uniquely identify the rows in at least one of
the tables to avoid ambiguous results.
Answer: Row-Level Security restricts data access for certain users based on roles. To implement RLS:
1. In Power BI Desktop, navigate to the Modeling tab, then select Manage Roles.
2. Define roles by creating DAX filters on tables (e.g., [Region] = "East" for a Sales Manager in
the East region).
3. After publishing the report to Power BI Service, assign these roles to users or groups through
the Security settings.
Example: A role might restrict sales data so that users can only see the data for their region. You
would create a filter using DAX like:
DAX
Copy code
[Region] = USERPRINCIPALNAME()
This dynamically filters the data based on the current user's login.
8. What is the use of Power BI Gateways, and when would you configure one?
Answer: Power BI Gateways are used to facilitate secure data transfer between on-premises data
sources and Power BI service. It allows scheduled refreshes and DirectQuery connections to on-
premise databases like SQL Server, Oracle, and more.
When your data is stored on-premises, and you need to refresh datasets in Power BI Service.
When using DirectQuery for real-time or near real-time reporting from on-premise data
sources.
Personal Gateway: Meant for individual users to connect to their data for development
purposes.
Enterprise Gateway: Designed for multiple users and datasets, allowing centralized
management and control of data connections.
9. How do you publish a Power BI report, and what steps would you take for deployment in a
production environment?
Use deployment pipelines to manage the movement from development, to testing, and to
production workspaces.
Conduct UAT (User Acceptance Testing) to ensure that the visuals, filters, and performance
are as expected.
Set up monitoring and error logging using Power BI’s audit logs and performance analyzer.
10. What are the limitations of Power BI and how do you overcome them?
Data Size Limit: Power BI has a 1 GB limit for a dataset in Power BI Pro. Overcome by
optimizing data models or using Power BI Premium.
DirectQuery Limitations: In DirectQuery mode, some DAX functions and aggregations may
not be supported. Overcome by using Import Mode or designing optimized queries.
Complex DAX: Calculating across large datasets with complex DAX can be slow. Overcome by
pre-calculating values, or using summarized data models.
Visual Limits: Some visual customizations or interactivity can be limited. Overcome by using
custom visuals or Power BI Embedded.
ChatGPT said:
ChatGPT
In Power BI, workspaces are containers where users can collaborate and share content such as
reports, dashboards, datasets, and dataflows. Understanding the differences between My
Workspace and workspaces is crucial for managing content and user permissions effectively. Here’s a
detailed comparison:
My Workspace is the personal workspace for individual Power BI users. Each user has their own My
Workspace by default when they sign up for Power BI. It serves as a private environment where you
can upload and work on your own reports and dashboards.
Features of My Workspace:
Private Content: Only the owner (you) can view and manage the content in My Workspace.
You cannot share content directly from My Workspace.
Limited Collaboration: My Workspace is not meant for collaboration. If you want to share
content with others, you need to publish it to a shared workspace or a Power BI app.
Storage Limits: My Workspace has storage limits for Pro and Premium users:
o Premium users benefit from additional capacity but still should manage storage
effectively.
Publish to Web: You can publish content from My Workspace directly to the web for public
access, but this does not offer granular sharing or control.
Usage Scenarios:
Workspaces in Power BI (previously called App Workspaces) are designed for collaboration and
content sharing within teams or departments. Multiple users can have different roles and
permissions within a workspace.
Features of Workspaces:
Collaboration: Multiple users can work together on reports, dashboards, and datasets in a
shared workspace.
Roles & Permissions: You can assign different roles (Admin, Member, Contributor, Viewer)
with varying levels of permissions:
o Admin: Full control over the workspace, including managing members, datasets, and
permissions.
o Contributor: Can create and modify content but cannot publish it as an app or
manage workspace settings.
o Viewer: Can only view the content but cannot edit or modify anything.
Sharing and Publishing: Workspaces allow content to be shared with specific users or
groups. You can also publish an App from the workspace, which packages content into a
managed app that can be shared more broadly within your organization.
Content Management: You can store multiple reports, datasets, dataflows, and dashboards.
You can also connect external data sources to datasets within the workspace.
Storage Capacity: If the workspace is tied to a Power BI Premium capacity, storage limits are
much higher and are shared across all users of that workspace.
Content Certification and Promotion: Reports and datasets in workspaces can be certified or
promoted within the organization to ensure trust in the data.
Usage Scenarios:
Key Differences:
Sharing Limited, cannot share directly Can share with specific users or groups
Publishing Can publish to web (public) Can publish apps for organizational use
App Creation Not possible Can publish and manage Power BI Apps
Best Practices:
Use My Workspace for personal development, prototyping, or reports that are only relevant
to you.
Use Workspaces for team collaboration, distributing reports across the organization, and
managing permissions effectively.
For larger organizations, consider utilizing Power BI Premium capacity for workspaces that
handle heavy data workloads or require advanced AI or paginated reports.
Would you like more details on managing workspace roles or any specific scenarios?
4o
ChatGPT
Power BI has several licensing options, each catering to different user needs and data storage
capacities. Here's a breakdown of the most common Power BI licenses and their data size limits:
1. Power BI Free
Cost: Free
Usage: Suitable for individual use and creating reports and dashboards.
Features:
o Cannot share reports with others unless they also have Power BI Free.
2. Power BI Pro
Usage: For individual users or small teams who need collaboration features.
Features:
Usage: For users needing advanced features like paginated reports and AI capabilities.
Features:
Cost: Starts at around $4,995 per dedicated cloud resource/month (pricing may vary).
Features:
5. Power BI Embedded
Usage: For application developers looking to embed Power BI capabilities in their apps.
Features:
o Same capabilities as Premium but targeted for independent software vendors (ISVs)
and developers to embed Power BI reports within their own applications.
Cost: Included with Power BI Premium or SQL Server Enterprise Edition with Software
Assurance.
Features:
Summary Table:
Included in
Power BI Report Server Varies Varies Varies
Premium/SQL
All power bi dax functions in detail with examples asked during interview from Capgemini
2/2
ChatGPT said:
ChatGPT
Capgemini interviews, especially for Power BI roles, often focus on key DAX (Data Analysis
Expressions) functions, with practical examples to evaluate your ability to solve business scenarios.
Below are important DAX functions, detailed explanations, and examples that are frequently asked:
1. CALCULATE
Syntax:
DAX
Copy code
Example: Suppose you have a table Sales with columns SalesAmount and ProductCategory. You want
to calculate the total sales for a particular category, like "Electronics".
DAX
Copy code
Common Interview Scenario: You might be asked to create a measure that calculates sales for a
particular region or product category using CALCULATE.
2. FILTER
The FILTER function returns a table that represents a subset of another table or expression, based on
a logical condition.
Syntax:
DAX
Copy code
FILTER(<Table>, <Condition>)
Example: If you want to filter out the sales data where sales are greater than 1000:
DAX
Copy code
3. SUMX
The SUMX function returns the sum of an expression evaluated over a table.
Syntax:
DAX
Copy code
SUMX(<Table>, <Expression>)
Example: If you want to calculate total sales by multiplying quantity and price for each row:
DAX
Copy code
4. ALL / ALLEXCEPT
The ALL function removes filters on the columns, while ALLEXCEPT removes filters on all columns
except specified ones.
Syntax:
DAX
Copy code
ALL(<TableOrColumn>)
ALLEXCEPT(<Table>, <Column>)
Example: If you want to calculate total sales ignoring any filters applied to ProductCategory:
DAX
Copy code
Common Interview Scenario: You may be asked to ignore filters applied to certain columns in a
report while keeping others intact.
5. RELATED / RELATEDTABLE
The RELATED function is used to fetch a column from a related table in a one-to-many relationship.
RELATEDTABLE returns a table of values related to the current row.
Syntax:
DAX
Copy code
RELATED(<ColumnName>)
RELATEDTABLE(<TableName>)
Example: Fetch product details from a Products table into the Sales table:
DAX
Copy code
ProductName = RELATED(Products[ProductName])
Common Interview Scenario: Demonstrating how to work with related tables, especially in star-
schema or snowflake data models.
6. IF / SWITCH
The IF function checks for a condition and returns one value if the condition is TRUE and another
value if it’s FALSE. SWITCH evaluates an expression against a list of values and returns a
corresponding result.
Syntax:
DAX
Copy code
DAX
Copy code
Common Interview Scenario: Categorizing data based on conditions and using multiple conditions
with SWITCH.
7. DIVIDE
The DIVIDE function is preferred over basic division (/) because it handles division by zero,
preventing errors.
Syntax:
DAX
Copy code
Example: To calculate profit margin, handling cases where the denominator (Total Sales) could be
zero:
DAX
Copy code
Common Interview Scenario: Handling division safely in a business scenario (e.g., calculating ratios,
margins).
8. RANKX
The RANKX function returns the rank of each value in a table or expression.
Syntax:
DAX
Copy code
RANKX(<Table>, <Expression>, [Value], [Order])
DAX
Copy code
Common Interview Scenario: Ranking products, customers, or sales representatives based on their
performance.
9. EARLIER
The EARLIER function is used when you have nested row contexts and need to reference an earlier
row context.
Syntax:
DAX
Copy code
EARLIER(<Column>, [Number])
DAX
Copy code
Common Interview Scenario: Handling nested row context with EARLIER in iterative calculations.
10. LOOKUPVALUE
The LOOKUPVALUE function retrieves a value from a column based on a search condition.
Syntax:
DAX
Copy code
DAX
Copy code
11. SUMMARIZE
Syntax:
DAX
Copy code
DAX
Copy code
Common Interview Scenario: Grouping and aggregating data dynamically within DAX.
12. USERELATIONSHIP
The USERELATIONSHIP function activates a relationship between two columns that is inactive by
default.
Syntax:
DAX
Copy code
USERELATIONSHIP(<Column1>, <Column2>)
DAX
Copy code
TotalSalesWithInactiveDate = CALCULATE(SUM(Sales[SalesAmount]),
USERELATIONSHIP(Sales[OrderDate], Calendar[Date]))
Common Interview Scenario: Handling multiple relationships in a data model, especially where
inactive relationships are needed.
These functions return a range of dates starting from the beginning of the year, month, or quarter, up
to the current date.
Syntax:
DAX
Copy code
DATESYTD(<DatesColumn>)
DATESMTD(<DatesColumn>)
DATESQTD(<DatesColumn>)
DAX
Copy code
Common Interview Scenario: Time intelligence questions about calculating MTD, QTD, or YTD
measures.
These functions are commonly used in Power BI interviews, especially at Capgemini, where you’re
often asked to write or explain how you would use DAX for real-world reporting scenarios.
Understanding the context and purpose of these functions, with practical examples, will help you
during interviews.
4o