Power BI Interview Questions And Answers

65 Super Useful Power BI Interview Questions And Answers

In today’s data-driven business landscape, proficiency in business intelligence tools has become a must-have skill for analysts and data professionals. Among these tools, Microsoft Power BI stands out as a powerhouse for data visualization and business analytics. Whether you’re a job seeker looking to showcase your Power BI expertise or an interviewer aiming to assess candidates’ knowledge, understanding common Power BI interview questions is crucial.

This comprehensive guide dives into a curated list of Power BI interview questions and answers, carefully categorized by difficulty level. From fundamental concepts to advanced techniques, we’ve got you covered. We’ll explore:

  1. Beginner-Level Questions: These questions are perfect for those new to Power BI or interviewing for junior positions. They cover basic concepts, simple DAX formulas, and essential Power BI components.
  2. Intermediate-Level Questions: Designed for those with some experience, these questions delve into more complex topics like data modelling, advanced DAX functions, and performance considerations.
  3. Advanced-Level Questions: Tailored for Power BI experts, these questions tackle sophisticated concepts and techniques that demonstrate deep expertise in the tool.

Whether you’re preparing for an interview, looking to assess potential hires, or simply aiming to deepen your Power BI knowledge, this guide will be invaluable. Let’s embark on this journey to master Power BI interview questions and boost your confidence in the world of data analytics!

it training in nagpur

What is Power BI?

Power BI is a business analytics tool by Microsoft that enables users to connect to various data sources, transform and visualize data, and share insights across an organization. With features like interactive dashboards, real-time data monitoring, and powerful data modelling, Power BI helps users make data-driven decisions. It’s widely used for creating detailed reports, gaining insights, and improving data accessibility within teams.

Power BI vs Tableau

Power BI and Tableau are both powerful data visualization and business intelligence tools, but they have key differences in features, pricing, and usability:

1. Ease of Use

  • Power BI: Known for its user-friendly interface, Power BI integrates well with other Microsoft products (like Excel and Azure). It’s ideal for users familiar with Microsoft tools.
  • Tableau: Offers a more sophisticated, drag-and-drop interface that allows greater customization. It’s popular with data professionals who need advanced analytical capabilities but has a steeper learning curve.

2. Data Visualization

  • Power BI: Great for straightforward visualizations and dashboards, but Tableau generally offers more advanced visual customization options.
  • Tableau: Known for its superior data visualization capabilities, with more options for detailed, complex, and interactive visuals.

3. Data Handling Capacity

  • Power BI: Handles medium to large datasets efficiently, but may struggle with extremely large datasets without optimization.
  • Tableau: Often preferred for larger datasets due to better performance and more scalable data handling capabilities.

4. Pricing

  • Power BI: More cost-effective, especially for small to medium businesses. It has a free version and lower-priced tiers, with Power BI Pro and Power BI Premium for added features.
  • Tableau: Generally more expensive, with subscription-based pricing that suits larger businesses or those needing advanced features.

5. Integration and Connectivity

  • Power BI: Best for organizations using the Microsoft ecosystem, as it integrates seamlessly with Azure, Excel, and other Microsoft services.
  • Tableau: Known for its flexibility, Tableau connects with a wider variety of external databases and sources, making it ideal for diverse environments.

6. Collaboration and Sharing

  • Power BI: Power BI Service makes sharing and collaboration straightforward, especially within organizations using Microsoft tools.
  • Tableau: Offers collaborative features but may require additional setup or licensing for sharing reports within organizations.

7. User Community and Support

  • Both have strong communities and support networks. Power BI benefits from Microsoft’s extensive documentation and user forums, while Tableau’s community is strong among data scientists and analytics professionals.

Summary

  • Choose Power BI if you want a cost-effective, user-friendly tool that works well within a Microsoft environment.
  • Choose Tableau if you need advanced data visualization, handle large datasets, and prefer flexible integration with multiple data sources.

Both tools can deliver powerful insights, with Power BI appealing more to businesses focused on cost-effectiveness and ease of use, and Tableau preferred by those prioritizing visual complexity and high data volume.

Uses of Power BI

Power BI is widely used for:

  1. Data Visualization: Create dynamic, visually engaging charts, graphs, and dashboards to represent data insights clearly.
  2. Real-Time Analytics: Monitor data in real-time, ideal for tracking KPIs, sales, or operations, allowing for quick decision-making.
  3. Business Intelligence Reporting: Generate and share comprehensive reports that consolidate data from various sources, helping organizations make informed business decisions.
  4. Data Transformation: Clean, organize, and structure raw data for better analysis and insights without needing extensive coding.
  5. Trend Analysis: Identify patterns and trends over time, useful in sales forecasting, customer behavior analysis, and strategic planning.
  6. Collaboration and Sharing: Easily share insights and reports across teams and departments, fostering a data-driven culture within the organization.
  7. Integration with Other Tools: Seamlessly connects with other Microsoft tools (Excel, Azure) and third-party data sources, offering flexible data integration.

Power BI is valuable for businesses looking to enhance data accessibility, streamline reporting, and drive strategic actions based on data insights.

Beginner Level Power BI Interview Questions And Answers

1. What is Power BI and what are its main components?

Power BI is a business analytics tool by Microsoft that allows users to visualise and share insights from their data. Its main components are:

  • Power BI Desktop: A Windows application for creating reports and datasets.
  • Power BI Service: A cloud-based platform for sharing and collaborating on reports.
  • Power BI Mobile: Apps for accessing reports on mobile devices.
  • Power BI Report Server: An on-premises solution for report publishing.

2. Explain the difference between Power BI Desktop and Power BI Service

Power BI Desktop is a Windows application used for creating reports and data models. It’s where you connect to data sources, transform data, and build visualisations. Power BI Service is a cloud-based platform where you publish reports created on the Desktop. It allows for sharing, collaboration, and accessing reports via web browsers.

3. What is DAX? Provide an example of a simple DAX formula

DAX (Data Analysis Expressions) is a formula language used in Power BI for creating calculated columns and measures. Example of a simple DAX formula:

Total Sales = SUM(Sales[Amount])

This creates a measure that sums up all values in the Amount column of the Sales table.

4. How do you connect Power BI to different data sources?

In Power BI Desktop:

  1. Click “Get Data” on the Home ribbon.
  2. Choose your data source (e.g., Excel, SQL Server, Web).
  3. Enter the necessary connection details (server name, database, etc.).
  4. Select the tables or views you want to import.
  5. Choose to either load the data or transform it in Power Query Editor.

5. What is the difference between import and DirectQuery modes in Power BI?

  • Import mode: Data is imported into Power BI’s in-memory storage. It offers faster performance and full DAX functionality but requires periodic refreshes.
  • DirectQuery mode: Data remains in the source database. Queries are sent to the source in real-time. It offers up-to-date data and can handle large datasets, but with some limitations on DAX functions and slower performance.

6. What are calculated columns and when should you use them?

Calculated columns are DAX expressions that add a new column to a table. Use them when:

  • You need the calculation for every row in the table.
  • The result will be used in multiple visualisations.
  • You need to create relationships between tables.

Example:

Full Name = Sales[First Name] & " " & Sales[Last Name]

7. How do you create a measure in Power BI?

To create a measure:

  1. Right-click on a table in the Fields pane.
  2. Select “New Measure”.
  3. Enter your DAX formula.
  4. Name the measure and click the checkmark to save.

Example:

Average Sales = AVERAGE(Sales[Amount])

8. What is the difference between calculated columns and measures?

  • Calculated columns: Computed for each row when data is refreshed, and stored in memory.
  • Measures: Computed on-the-fly when used in visualisation, not stored in memory.

Use calculated columns for row-level calculations, and measures for aggregate calculations.

9. What is a slicer in Power BI and how is it used?

A slicer is an interactive filter that allows users to narrow the portion of the dataset shown in other visualisations. To use:

  1. Select the Slicer visual from the Visualisations pane.
  2. Drag a field into the slicer.
  3. Users can then click on slicer items to filter other visuals on the page.

10. How do you create a hierarchy in Power BI?

To create a hierarchy:

  1. In the Fields pane, right-click on a field.
  2. Select “New Hierarchy”.
  3. Drag and drop other fields onto the new hierarchy.

Example: Create a Date hierarchy with Year, Quarter, Month, Day.

11. What is the difference between a clustered column chart and a stacked column chart?

  • Clustered column chart: Shows multiple series side by side. Good for comparing categories.
  • Stacked column chart: Stacks series on top of each other. Good for showing part-to-whole relationships.

12. Explain what Power Query is and how it’s used in Power BI

Power Query is a data transformation and preparation engine. In Power BI, it’s used to:

  • Connect to data sources.
  • Clean and transform data (e.g., remove duplicates, change data types).
  • Combine data from multiple sources.

Access it by clicking “Transform data” in Power BI Desktop.

13. What is the purpose of the SUM function in DAX?

SUM adds up all numbers in a column. Example:

Total Revenue = SUM(Sales[Revenue])

It’s often used in measures for aggregating numeric values.

14. How do you refresh data in a Power BI report?

In Power BI Desktop:

  • Click “Refresh” in the Home tab.

In Power BI Service:

  • Set up scheduled refreshes in the dataset settings.
  • Click “Refresh now” on a dataset.

15. What is the difference between a card and a KPI visual in Power BI?

  • Card: Displays a single numeric value.
  • KPI (Key Performance Indicator): Shows a primary value, a goal, and often a status indicator (like good/bad trend).

16. How do you create a basic filter in Power BI?

  1. Select a visual.
  2. In the Filters pane, find the field you want to filter.
  3. Choose filter type (Basic, Advanced, Top N, etc.).
  4. Set your filter conditions.

17. What is the purpose of the COUNT function in DAX?

COUNT returns the number of rows that contain non-blank values in a column. Example:

Number of Products = COUNT(Products[ProductName])

18. How do you change the theme of a Power BI report?

  1. Go to the View tab.
  2. Click on “Themes”.
  3. Choose from built-in themes or import a custom theme JSON file.

19. What is the difference between a report and a dashboard in Power BI?

  • Report: Multi-page document with visualisations and filters. More detailed and interactive.
  • Dashboard: Single-page canvas with pinned visuals from various reports. Provides a high-level view.

20. How do you share a Power BI report with others?

In Power BI Service:

  1. Open the report.
  2. Click “Share” in the top menu.
  3. Enter the email addresses of recipients.
  4. Set permissions (view or edit).
  5. Click “Share”.

Note: Sharing requires a Power BI Pro licence or Premium capacity.

Intermediate Level Power BI Interview Questions And Answers

21. Explain what a star schema is and why it’s important in Power BI.

A star schema is a data modelling technique where a central fact table is connected to multiple dimension tables. In Power BI, it’s important because:

  • It simplifies complex data relationships
  • Improves query performance
  • Makes it easier to create measures and calculations

Example:

  • Fact table: Sales (contains Sales Amount, Quantity)
  • Dimension tables: Date, Product, Customer, Store

Each dimension table connects to the fact table, forming a star-like structure.

22. Explain the concept of filter context in Power BI.

Filter context is the set of filters applied to a calculation in Power BI. It determines which rows are included in a measure’s calculation. Filter context can be:

  • Implicit: Applied by slicers, filters, or rows/columns in a visual
  • Explicit: Modified using DAX functions like CALCULATE

Example:

Total Sales = SUM(Sales[Amount])
Filtered Sales = CALCULATE(SUM(Sales[Amount]), Product[Category]="Electronics")

The second measure uses CALCULATE to explicitly modify the filter context.

23. What is row context and how does it differ from filter context?

Row context is the current row when evaluating a calculated column or a row-level calculation in an iterator function (like SUMX).

Differences:

  • Row context operates on a single row; filter context on multiple rows
  • Row context is automatic in calculated columns; filter context is used in measures

Example (row context):

Profit = Sales[Revenue] - Sales[Cost]

This calculated column uses row context to access values in the current row.

24. How do you create a date table in Power BI?

You can create a date table using DAX:

Date = 
ADDCOLUMNS(
    CALENDAR(DATE(2020,1,1), DATE(2025,12,31)),
    "Year", YEAR([Date]),
    "Month", FORMAT([Date], "mmmm"),
    "MonthNo", MONTH([Date]),
    "Quarter", "Q" & QUARTER([Date]),
    "Day", DAY([Date])
)

This creates a date table from 2020 to 2025 with various date attributes.

25. What is the purpose of the RELATED function in DAX?

RELATED retrieves a value from a related table in a many-to-one relationship. It’s used in calculated columns to access values from the “one” side of a relationship.

Example:

Product Category = RELATED(Products[Category])

This adds the product category to the Sales table, assuming a relationship exists between Sales and Products.

26. Explain the difference between SUMX and SUM functions.

  • SUM: Adds up all values in a column
  • SUMX: Allows for row-by-row calculation before summing

Example:

Total Revenue = SUM(Sales[Revenue])
Total Profit = SUMX(Sales, Sales[Revenue] - Sales[Cost])

SUMX is useful when you need to perform calculations on each row before aggregating.

27. What are M functions and when would you use them?

M functions are used in Power Query for data transformation. Use them when:

  • Cleaning and shaping data during the ETL process
  • Creating custom data transformations
  • Combining data from multiple sources

Example (combining First and Last Name columns):

= Table.AddColumn(#"Previous Step", "Full Name", each [First Name] & " " & [Last Name])

28. How do you handle slowly changing dimensions in Power BI?

Slowly Changing Dimensions (SCD) can be handled by:

  • Type 1: Overwrite the old value (no history)
  • Type 2: Add a new row with the changed attributes, keeping historical data

Implementation in Power BI:

  • Use Power Query to identify changes and create appropriate rows
  • Add columns like “Start Date”, “End Date”, and “Is Current” to track changes
  • Create relationships based on both the dimension key and date for accurate historical reporting

29. What is the purpose of the CALCULATE function in DAX?

CALCULATE modifies the filter context for a calculation. It’s used to:

  • Apply specific filters to a measure
  • Remove existing filters
  • Implement complex calculations

Example:

Sales in USA = CALCULATE(SUM(Sales[Amount]), Customer[Country]="USA")

This calculates sales only for customers in the USA, regardless of other filters applied.

30. Explain the concept of time intelligence functions in DAX.

Time intelligence functions in DAX allow for calculations over time periods like year-to-date, previous year, etc. They require a date table.

Example:

YTD Sales = TOTALYTD(SUM(Sales[Amount]), 'Date'[Date])

This calculates year-to-date sales using the Date table.

31. How do you create a rolling average in Power BI?

Use the AVERAGEX function with a date range:

30 Day Avg Sales = 
AVERAGEX(
    DATESINPERIOD('Date'[Date], MAX('Date'[Date]), -30, DAY),
    [Total Sales]
)

This calculates the average sales for the last 30 days.

32. What is the difference between a matrix and a table in Power BI?

  • Table: Displays data in a grid format with rows and columns
  • Matrix: Allows for row and column groupings, similar to a pivot table

Matrices are better for hierarchical data and cross-tabular reports.

33. How do you implement row-level security in Power BI?

Steps:

  1. Create a role in Power BI Desktop:
  • Go to Modelling tab > Manage Roles > Create
  1. Define filters for the role:
   [Region] = USERNAME() or [Region] = "All"
  1. Test the role in Power BI Desktop
  2. Publish to Power BI Service
  3. Assign users to roles in Power BI Service

34. What are bookmarks in Power BI and how are they used?

Bookmarks capture a specific view of a report page, including filters, slicers, and visual states. Use them to:

  • Create a presentation-like flow in your report
  • Switch between different views of data
  • Implement “what-if” scenarios

To create: View > Bookmarks > Add

35. Explain the concept of bidirectional cross-filtering.

Bidirectional cross-filtering allows filters to propagate in both directions of a relationship. It’s useful for many-to-many relationships or when you need to filter a “lookup” table based on selections in the fact table.

To enable: In the relationship view, double-click a relationship and check “Apply filter in both directions”.

36. What is the difference between explicit and implicit measures?

  • Explicit measures: DAX calculations defined in the model
  • Implicit measures: Auto-generated aggregations (sum, count, etc.) of columns

Explicit measures offer more control and complex calculations. Implicit measures are quick for simple aggregations but have limitations.

37. How do you optimise Power BI reports for better performance?

  • Use import mode instead of DirectQuery where possible
  • Avoid unnecessary visuals and complex DAX
  • Use incremental refresh for large datasets
  • Implement query folding in Power Query
  • Use variables in DAX to store intermediate results
  • Avoid bidirectional relationships unless necessary
  • Use integers for keys in relationships

38. What is the purpose of the ALL function in DAX?

ALL removes all filters from a table or column(s). It’s often used within CALCULATE to create a baseline for comparison.

Example:

% of Total Sales = 
DIVIDE(
    SUM(Sales[Amount]),
    CALCULATE(SUM(Sales[Amount]), ALL(Sales))
)

This calculates the percentage of total sales, ignoring all applied filters.

39. How do you create a parameter in Power BI?

  1. Create a new query in Power Query
  2. Add a custom column with your parameter values
  3. Set the query type to “List”
  4. Close and Apply
  5. Create a slicer using this new field

Example (for a date parameter):

let
    Source = {1..12},
    Custom = List.Transform(Source, each Date.AddMonths(#date(2023,1,1), _ - 1))
in
    Custom

40. Explain the difference between FILTER and CALCULATE for filtering data.

  • FILTER: Returns a table with filtered rows. Used within CALCULATE or as a table expression.
  • CALCULATE: Modifies the filter context for a measure.

Example:

High Value Sales = CALCULATE(SUM(Sales[Amount]), FILTER(Sales, Sales[Amount] > 1000))

Here, FILTER creates a subset of Sales, which CALCULATE then uses it to modify the filter context for the SUM.

41. What is the purpose of the EARLIER function in DAX?

The EARLIER function returns the value of a column in an outer row context. It’s often used in calculated columns to refer to previous row values within the same table.

  • Example:
    DAX Running Total = SUMX( FILTER(Sales, Sales[Date] <= EARLIER(Sales[Date])), Sales[Amount] )
    This formula calculates a running total by referencing previous rows in the Sales table.

42. How do you handle currency conversion in Power BI?

Steps to handle currency conversion:

  1. Create a currency conversion table containing exchange rates.
  2. Establish a relationship between the currency conversion table and your fact table.
  3. Create a DAX measure for the converted amounts.
    DAX Sales in USD = SUMX( Sales, Sales[Amount] / RELATED(ExchangeRates[Rate]) )
  4. Use parameters to allow the user to select the target currency for conversion dynamically.

43. What are custom visuals in Power BI and how do you use them?

Custom visuals are third-party visualisations that extend Power BI’s capabilities.

Steps to use custom visuals:

  1. Download the visual from AppSource or import a .pbiviz file.
  2. In Power BI Desktop, go to the Visualizations pane, click the three dots, and select Import from marketplace.
  3. Add the custom visual to your report.
  4. Assign the necessary fields to the visual.
  • Example: Using the “Hierarchy Slicer” for multi-level filtering.

44. Explain the concept of drill-through in Power BI reports.

Drill-through enables users to navigate from a summary page to a detailed report page while passing filter context from the source visual.

Steps to set up drill-through:

  1. Create a destination page for drill-through.
  2. Drag fields into the Drill-through filter pane.
  3. Users can then right-click on a data point in the main report and select Drill-through to view detailed information.
  • Example: Drill-through from a summary sales report to view product or regional sales details.

45. How do you implement incremental refresh in Power BI?

Incremental refresh improves performance by loading only new or updated data during refreshes.

Steps:

  1. In Power Query, create parameters for start and end dates.
  2. Filter your data using these parameters.
  3. In Power BI Desktop, right-click the table and select Incremental Refresh.
  4. Set the refresh policy, e.g., refreshing the last 5 days of data.
  5. Publish to Power BI Service for scheduled refresh.

46. What is the difference between SUMMARIZE and SUMMARIZECOLUMNS functions?

  • SUMMARIZE: Groups data and allows adding calculated columns.
  • SUMMARIZECOLUMNS: More flexible, supports multiple grouping columns and direct measure references without needing CALCULATETABLE.
  • Example:
    DAX SUMMARIZECOLUMNS( 'Date'[Year], 'Product'[Category], "Total Sales", SUM(Sales[Amount]) )
    This groups sales by year and product category, returning total sales.

47. How do you create a dynamic title for a visual in Power BI?

Steps:

  1. Create a measure to generate dynamic text:
    DAX Dynamic Title = "Sales for " & SELECTEDVALUE(Product[Category], "All Categories") & ": " & FORMAT([Total Sales], "$#,##0")
  2. Add a Card visual and set the value to the dynamic title measure.
  3. Format the card to make it look like a title for your visual.

48. Explain the concept of virtual relationships in Power BI.

Virtual relationships are created using DAX functions like TREATAS, without needing a physical relationship in the model.

  • Example:
    DAX Virtual Sales = CALCULATE( [Total Sales], TREATAS(VALUES(DimProduct[ProductKey]), FactSales[ProductKey]) )
    This creates a virtual relationship between DimProduct and FactSales for calculations.

49. What is the purpose of the USERELATIONSHIP function?

USERELATIONSHIP activates an inactive relationship between two tables for a specific calculation.

  • Example:
    DAX Sales at Ship Date = CALCULATE( [Total Sales], USERELATIONSHIP('Date'[Date], Sales[ShipDate]) )
    This activates the relationship between Date and Sales[ShipDate] for calculating total sales based on the shipping date.

50. How do you handle many-to-many relationships in Power BI?

Steps:

  1. Create a bridge table to connect the two many-side tables.
  2. Enable bidirectional cross-filtering for one of the relationships.
  3. Use the CROSSFILTER function to control filter direction in DAX:
    DAX Sales by Store = CALCULATE( [Total Sales], CROSSFILTER(Bridge[ProductID], Product[ProductID], BOTH) )
    This enables bidirectional filtering between the Bridge and Product tables for calculations.

Advanced Level Power BI Interview Questions And Answers

51. What is the difference between AVERAGEX and AVERAGE functions?

  • AVERAGE:
  • Calculates the arithmetic mean of a column directly.
  • AVERAGEX:
  • Evaluates an expression for each row in a table and then calculates the average of those results.
  • Example using AVERAGEX:
    DAX Avg Profit Margin = AVERAGEX( Sales, DIVIDE(Sales[Revenue] - Sales[Cost], Sales[Revenue]) )
    This calculates the average profit margin across all sales transactions.

52. How do you create a tooltip page in Power BI?

  • Steps to create a tooltip page:
    1. Create a new page in Power BI and set its size to a small one, such as Tooltip (under page settings).
    2. Go to the “Page Information” section and toggle the Tooltip option on.
    3. Add visuals to the tooltip page (e.g., detailed metrics or charts).
    4. On the main report page, select a visual > go to Format > Tooltips > Page > Select your tooltip page.
    5. When a user hovers over the main report visual, the tooltip page will display additional details.

53. Explain the concept of query folding and its importance.

  • Query folding is the process where Power Query transforms are converted into native queries that are executed by the data source.
  • Importance:
    • Reduces the amount of data that needs to be loaded into Power BI.
    • Improves performance by pushing data transformations back to the data source.
  • To encourage query folding, use native Power Query functions (e.g., filter, group) instead of custom M code.

54. What are R and Python visuals in Power BI and when would you use them?

  • R and Python visuals allow users to create custom visualisations using R or Python scripts.
  • When to use them:
    • For advanced statistical analysis, machine learning, or custom visualisations that Power BI doesn’t support natively.
  • Steps:
    1. Enable R or Python scripting in Power BI Desktop (File > Options > R/Python scripting).
    2. Add an R or Python visual to your report.
    3. Write your R or Python code in the provided script editor.
  • Example (R visual for correlation plot):
    R library(corrplot) corrplot(cor(dataset))

55. How do you implement conditional formatting in Power BI?

  • Steps:
    1. Select a visual in Power BI.
    2. In the Format pane, locate the field you want to format (e.g., the values or data labels).
    3. Click on the three dots next to the field > choose Conditional formatting.
    4. Select the type of conditional formatting (e.g., colour scale, rules, icons).
    5. Set up the conditions and apply corresponding formats.
  • Example: Colour sales values green if above target, red if below target.

56. What is the purpose of the SWITCH function in DAX?

  • SWITCH is used to evaluate an expression against a list of values and return a result based on the matching condition. It is useful for replacing nested IF statements.
  • Example:
    DAX Product Tier = SWITCH( TRUE(), Sales[Amount] > 1000, "High", Sales[Amount] > 500, "Medium", "Low" )
    This classifies products into “High”, “Medium”, or “Low” tiers based on the sales amount.

57. How do you handle ragged hierarchies in Power BI?

  • Ragged hierarchies are hierarchies with inconsistent levels, meaning some nodes don’t have the full depth.
  • Steps to handle ragged hierarchies:
    1. Use Power Query to fill empty levels with placeholder values, or create custom columns for hierarchy levels.
    2. Create a DAX measure that handles the hierarchy display by returning the correct level based on the context.
  • Example:
    DAX Hierarchy Display = SWITCH( TRUE(), ISBLANK([Level3]), [Level2], ISBLANK([Level2]), [Level1], [Level3] )
    This measure shows the correct hierarchy level when some nodes are missing.

58. Explain the concept of composite models in Power BI.

  • Composite models allow mixing Import and DirectQuery storage modes in a single report or dataset.
  • Benefits:
    • Combine the performance of imported data with the real-time querying of DirectQuery.
    • Enable improved performance for large datasets by using aggregations.
  • Steps:
    1. Import some tables (for smaller, more frequently used data).
    2. Use DirectQuery for larger tables or tables that require real-time updates.
    3. Create relationships between the imported and DirectQuery tables and use aggregations for frequently queried data.

59. How do you use DAX Studio to optimise DAX queries?

  • DAX Studio is an external tool used to write, execute, and analyse DAX queries.
  • Steps:
    1. Connect DAX Studio to your Power BI model.
    2. Write your DAX query or select a slow-performing measure to analyse.
    3. Use the Server Timings tab to track the performance of your DAX query.
    4. Based on the analysis, look for ways to optimise the query (e.g., reducing the number of Storage Engine queries or improving filter context management).

60. Explain the concept of parameter tables and how they can be used for dynamic reporting.

  • Parameter tables are disconnected tables used to allow user selections that dynamically change the report’s calculations or visuals.
  • Steps:
    1. Create a table in Power Query that holds the possible parameter values (e.g., time periods or metric types).
    2. Add a slicer that allows users to select values from the parameter table.
    3. Use the SELECTEDVALUE function in your measures to reference the selected parameter.
  • Example:
    DAX Dynamic Time Calc = VAR SelectedPeriod = SELECTEDVALUE(TimePeriods[Period]) RETURN SWITCH( SelectedPeriod, "YTD", [YTD Sales], "MTD", [MTD Sales], [Total Sales] )
    This measure dynamically changes the calculation based on the selected time period.

61. How do you implement dynamic row-level security based on the user’s role?

  • Steps to implement dynamic row-level security (RLS):
    1. Create a table with user roles and the data each role is allowed to access (e.g., by region or department).
    2. In Power BI Desktop, create a role in the Manage Roles section.
  • Example: DAX [Region] = LOOKUPVALUE(UserRoles[AllowedRegion], UserRoles[Email], USERNAME())
    1. Publish the report to Power BI Service and map Azure AD groups or users to the created roles.

This ensures that different users see only the data they are authorised to access.

62. What is the purpose of the ALLSELECTED function and how does it differ from ALL?

  • ALL: Removes all filters from a table or column, regardless of user selections in the report.
  • ALLSELECTED: Removes only the filters applied in the current query context, keeping the user’s selections intact.
  • Example:
    DAX % of Selected Total = DIVIDE( [Total Sales], CALCULATE([Total Sales], ALLSELECTED(Sales)) )
    This measure calculates the percentage of total sales within the current selection context, rather than across all data.

63. Explain how you would implement a dynamic Top N filter in Power BI.

  • Steps to implement a dynamic Top N filter:
    1. Create a parameter table with N values (e.g., 5, 10, 20).
    2. Create a ranking measure:
      DAX Rank = RANKX( ALL(Products), [Total Sales], , DESC )
    3. Create a measure for filtering based on the selected N value:
      DAX Top N Filter = VAR TopN = SELECTEDVALUE(TopNParam[N]) RETURN [Rank] <= TopN
    4. Apply this measure in the visual-level filter pane to dynamically adjust the Top N results.

64. How do you use DAX to create a cumulative total that resets based on a condition?

  • To create a cumulative total that resets (e.g., at the start of a year), use RANKX and CALCULATE in conjunction with a filter condition.
  • Example:
    DAX Cumulative Total = CALCULATE( SUM(Sales[Amount]), FILTER( ALL(Sales), Sales[Date] <= MAX(Sales[Date]) && Sales[Year] = MAX(Sales[Year]) ) )
    This measure calculates the cumulative total of sales, resetting at the beginning of each year.

65. Explain the concept of disconnected tables and when you might use them.

  • Disconnected tables are tables that do not have relationships with other tables in the data model. They are used to allow users to make selections that don’t directly filter data but are used in measures for dynamic calculations.
  • Example:
    DAX Selected Metric = SWITCH( SELECTEDVALUE(MetricTable[Metric]), "Sales", [Total Sales], "Profit", [Total Profit] )
    The MetricTable is disconnected, but its selections are used in the calculation of the Selected Metric measure.

Conclusion