Combining Multiple Data Sources into a Unified Report in Power BI
Course: Microsoft Power BI Training
Topic: Combining Multiple Data Sources into a Unified Report
Course Link: Microsoft Power BI Training
Demo Link: Register for a Free Course Demo
Website: JustAcademy
1. Introduction to Combining Multiple Data Sources
In real-world business environments, information is rarely stored in a single location. Sales data may be maintained in Excel files, customer information in SQL databases, inventory records in enterprise applications, and marketing data in online platforms. Analyzing each source independently makes it difficult to understand overall business performance.
Microsoft Power BI allows users to connect to multiple data sources, transform and combine their information, establish relationships between tables, and create a unified report containing meaningful insights.
A unified report brings data from different systems into a common analytical environment. It helps organizations compare performance, identify trends, monitor key performance indicators (KPIs), and make informed decisions.
Example
A retail company stores its information in three different sources:
- Excel: Monthly sales transactions.
- SQL Server: Customer information.
- CSV file: Product and inventory details.
By combining these sources in Power BI, the company can create a report showing total sales by product, revenue by region, customer purchasing behavior, and inventory performance.
2. Learning Objectives
After completing this topic, learners should be able to:
- Understand the importance of integrating multiple data sources.
- Identify supported Power BI data sources.
- Connect Power BI to Excel, CSV, databases, and other systems.
- Import data and configure DirectQuery where supported.
- Clean and transform data using Power Query.
- Append and merge tables from different sources.
- Build relationships between tables in a data model.
- Handle different data types, column names, and data formats.
- Create a unified data model for reporting.
- Design interactive reports using combined data.
- Validate results and troubleshoot common integration problems.
3. Understanding Data Sources in Power BI
A data source is any system, file, application, or service from which Power BI retrieves information. The source determines how data is accessed, refreshed, transformed, and maintained.
3.1 Common Data Sources
| Data Source |
Description |
Example Use Case |
| Microsoft Excel |
Spreadsheet files containing tables, formulas, and structured records. |
Sales reports and budgets. |
| CSV and Text Files |
Delimited files containing structured information. |
Product lists and transaction exports. |
| SQL Server |
Relational database containing structured business data. |
Customers, orders, and payments. |
| MySQL |
Relational database used by applications and websites. |
Website orders and customer accounts. |
| SharePoint |
Collaboration platform for files and organizational information. |
Departmental reports and shared Excel files. |
| Web |
Data available from supported web pages or web endpoints. |
Public statistics and web-based data. |
| JSON and XML |
Structured formats commonly used by APIs and applications. |
Application data and API responses. |
| Cloud Data Warehouses |
Cloud platforms that store analytical datasets. |
Enterprise reporting and large datasets. |
| Power BI Semantic Models |
Existing published models that can supply data and measures to reports. |
Centralized organizational reporting. |
3.2 Why Use Multiple Data Sources?
- Complete information: Different systems provide different parts of the business picture.
- Improved accuracy: Combining verified information can reduce inconsistencies caused by disconnected reports.
- Better analysis: Users can compare sales, customers, products, costs, and operations.
- Reduced manual work: Repeatable data preparation can replace manual copying between files.
- Consistent reporting: Teams can use shared definitions and common business metrics.
- Faster decisions: Managers can review consolidated results in one report.
4. Understanding Data Integration Methods
Power BI supports several approaches to combining data. The correct method depends on the structure of the sources, the reporting requirements, data volume, and performance needs.
4.1 Import Mode
Import mode loads data into the Power BI semantic model. Power BI stores a compressed copy of the imported data, allowing reports to query the model efficiently.
Advantages:
- Generally provides fast interactive report performance.
- Supports extensive modeling and DAX calculations.
- Works well for scheduled reporting and analytical dashboards.
Limitations:
- Source changes are not reflected until data is refreshed.
- Model size and refresh duration must be considered.
- Some sources require a gateway or additional configuration for scheduled refresh.
4.2 DirectQuery Mode
DirectQuery allows Power BI to query supported data sources when report users interact with visuals rather than importing all source data into the model.
Advantages:
- Can access current source data without importing the entire dataset.
- Can be suitable for large datasets that are impractical to import.
- Allows some source-side security and processing patterns to be retained.
Limitations:
- Performance depends on the source system and query design.
- Some modeling and transformation capabilities have restrictions.
- Source availability and network latency can affect report responsiveness.
4.3 Composite Models
Composite models allow supported combinations of storage modes and data sources within a single semantic model. For example, an imported sales summary may be used alongside DirectQuery data from a database.
Composite models are useful when a report needs both fast imported data and access to selected source data. However, relationships, cross-source queries, security, and performance require careful testing.
4.4 Dataflows and Reusable Data Preparation
Power BI dataflows can centralize supported data extraction and transformation steps so that multiple semantic models or reports can reuse prepared data. Availability and features depend on the Power BI environment and licensing.
5. Connecting to Multiple Data Sources
The first step in creating a unified report is connecting Power BI Desktop to each required source.
5.1 Connecting to an Excel File
- Open Power BI Desktop.
- Select Home > Get data.
- Choose Excel workbook.
- Browse to the required file and select Open.
- Review the available worksheets and tables in the Navigator window.
- Select the required tables or sheets.
- Choose Transform Data to clean the data before loading, or Load to import it directly.
Example: Connect to Sales.xlsx, containing OrderID, OrderDate, ProductID, CustomerID, Quantity, and SalesAmount.
5.2 Connecting to a CSV File
- Select Home > Get data > Text/CSV.
- Select the required CSV file.
- Verify the delimiter, encoding, and data preview.
- Choose Transform Data to inspect and clean the data.
- Confirm that column headers and data types are correct.
Example: Connect to Products.csv, containing ProductID, ProductName, Category, and UnitPrice.
5.3 Connecting to SQL Server
- Select Home > Get data > SQL Server.
- Enter the server name and optional database name.
- Choose Import or DirectQuery, where available.
- Select the appropriate authentication method.
- Browse the Navigator to select tables or views.
- Choose Transform Data or Load.
Always use authorized credentials and the appropriate access permissions. Avoid embedding sensitive credentials in scripts or shared files.
5.4 Adding Another Source to an Existing Report
- Open the existing Power BI Desktop report.
- Select Home > Get data.
- Choose the new source type.
- Connect and select the required data.
- Transform the new table if needed.
- Load the data into the model.
- Inspect the Model view and create the necessary relationships.
- Update visuals and measures to use the integrated model.
6. Understanding Power Query
Power Query is the data preparation and transformation engine used by Power BI. It helps users clean, reshape, combine, and standardize information before it is loaded into a semantic model.
Power Query records transformations as steps. These steps are generally reapplied during refresh, which makes data preparation repeatable.
6.1 Opening Power Query Editor
- Open Power BI Desktop.
- Select Home > Transform Data.
- Review the Queries pane on the left.
- Select a query to view its data preview.
- Use the ribbon and column menus to transform the data.
- Review the Applied Steps pane.
- Select Close & Apply when the preparation is complete.
6.2 Common Data Transformation Tasks
| Transformation |
Purpose |
Example |
| Rename Columns |
Standardize field names. |
Cust_ID becomes CustomerID. |
| Change Data Type |
Assign appropriate types to fields. |
Convert OrderDate to Date. |
| Remove Duplicates |
Remove repeated records based on selected columns. |
Deduplicate a customer master table. |
| Replace Values |
Standardize inconsistent labels. |
Replace Mum with Mumbai. |
| Filter Rows |
Keep records meeting specified conditions. |
Exclude cancelled orders from a particular analysis. |
| Split Columns |
Separate combined fields. |
Split a full name into first and last name. |
| Merge Queries |
Join tables using matching columns. |
Combine orders with customer details. |
| Append Queries |
Stack rows from compatible tables. |
Combine January and February sales. |
| Group By |
Aggregate rows by selected fields. |
Calculate sales totals by region. |
7. Standardizing Data from Different Sources
Before combining data, make sure the relevant fields use consistent names, types, formats, and business definitions. Data that appears similar may still contain differences that prevent correct integration.
7.1 Standardizing Column Names
Consider these fields from different sources:
- Excel:
Customer_ID
- SQL Server:
CustID
- CSV:
Customer Number
If the fields represent the same business identifier, rename them to a consistent name such as CustomerID. Renaming columns improves readability and makes subsequent transformations easier to maintain.
7.2 Standardizing Data Types
Matching columns should use compatible data types before they are merged or related.
| Field |
Recommended Type |
Reason |
| CustomerID |
Text or Whole Number, consistently applied |
Prevents mismatched join keys. Text is often safer for identifiers with leading zeros. |
| OrderDate |
Date |
Supports date filtering and time-based analysis. |
| SalesAmount |
Fixed Decimal Number or suitable currency-compatible type |
Supports financial calculations. |
| Quantity |
Whole Number or Decimal Number |
Depends on the product and measurement rules. |
| UnitPrice |
Fixed Decimal Number or suitable decimal type |
Supports price calculations. |
7.3 Handling Missing and Inconsistent Values
- Identify null values in important identifiers and business measures.
- Determine whether missing values should remain blank, be replaced, or cause records to be excluded.
- Standardize region names, product categories, and status values.
- Check whether dates use different regional formats.
- Preserve leading zeros in codes when they are meaningful.
- Document any assumptions used to clean the data.
Do not replace missing values with zero automatically. A missing sales amount and a confirmed zero sales amount have different meanings.
8. Combining Data Using Merge Queries
Merge Queries combines columns from two tables by matching records using one or more key columns. It is similar to a database join.
8.1 Example of a Merge
Suppose the Sales table contains:
| OrderID |
CustomerID |
SalesAmount |
| 101 |
C001 |
5000 |
| 102 |
C002 |
3500 |
| 103 |
C001 |
2200 |
The Customers table contains:
| CustomerID |
CustomerName |
City |
| C001 |
Rahul |
Mumbai |
| C002 |
Priya |
Pune |
Merge the tables using CustomerID to bring customer information into the sales records.
8.2 Steps to Merge Queries
- Open Power Query Editor.
- Select the primary query, such as Sales.
- Choose Home > Merge Queries or Merge Queries as New.
- Select the second query, such as Customers.
- Select the matching key column in each table.
- Choose the appropriate join kind.
- Confirm the operation.
- Expand the resulting nested table column.
- Select the fields to include, such as CustomerName and City.
- Verify the resulting row count and matching records.
8.3 Types of Joins
| Join Type |
Meaning |
Typical Use |
| Left Outer |
All rows from the first table and matching rows from the second. |
Keep every sales record and add available customer details. |
| Right Outer |
All rows from the second table and matching rows from the first. |
Keep every customer record while adding matching sales details. |
| Full Outer |
All rows from both tables, matched where possible. |
Identify matched and unmatched records across sources. |
| Inner |
Only rows with matches in both tables. |
Analyze records that have valid matches on both sides. |
| Left Anti |
Rows from the first table without a match in the second. |
Find sales records with unknown customer IDs. |
| Right Anti |
Rows from the second table without a match in the first. |
Find customers with no matching sales records. |
8.4 Important Merge Considerations
- Confirm that the selected columns represent the same business key.
- Check data types and whitespace before joining.
- Look for duplicate keys in the lookup table.
- Understand that duplicate matches can increase the number of rows.
- Use an appropriate join kind for the reporting objective.
- Check unmatched records after the merge.
9. Combining Data Using Append Queries
Append Queries combines rows from two or more tables into a single table. It is useful when multiple files contain the same type of information for different periods, locations, or departments.
9.1 Example of Append
January sales:
| OrderID |
Month |
Sales |
| 101 |
January |
10000 |
| 102 |
January |
8000 |
February sales:
| OrderID |
Month |
Sales |
| 103 |
February |
12000 |
| 104 |
February |
9500 |
Appending these tables produces a combined table containing four rows.
9.2 Steps to Append Queries
- Open Power Query Editor.
- Choose Home > Append Queries or Append Queries as New.
- Select Two tables or Three or more tables, as required.
- Choose the tables to combine.
- Confirm the append operation.
- Review the combined table and its column types.
- Check for missing values caused by columns present in only some source tables.
9.3 Merge vs. Append
| Feature |
Merge |
Append |
| Operation |
Combines columns using matching keys. |
Combines rows from multiple tables. |
| Typical Purpose |
Add customer details to sales records. |
Combine monthly sales files. |
| Table Structure |
Usually increases the number of columns. |
Usually increases the number of rows. |
| Matching Keys |
Required to identify related records. |
Not required to match individual records. |
| Column Names |
Used to expand selected fields from the related table. |
Corresponding column names are aligned; unmatched columns can contain nulls. |
10. Creating Relationships Between Tables
Not every data source needs to be merged into one large table. In many cases, the better approach is to load separate tables and connect them through relationships in the Power BI semantic model.
Relationships allow filters and calculations to work across tables while preserving a structured data model.
10.1 Example Data Model
A retail report may contain these tables:
- Sales: Transaction-level sales records.
- Customers: One record per customer.
- Products: One record per product.
- Date: One record per date.
- Regions: Region names and related attributes, if needed.
The Sales table can be related to Customers using CustomerID, Products using ProductID, and Date using OrderDate and the date table's Date column.
10.2 Creating a Relationship
- Load the required tables into Power BI Desktop.
- Open Model view.
- Drag a key column from one table to the corresponding column in another table, or use Manage relationships.
- Verify the selected columns and cardinality.
- Choose the appropriate cross-filter direction.
- Confirm the relationship and inspect the model diagram.
- Test the relationship by building a visual using fields from both tables.
10.3 Cardinality Types
| Cardinality |
Description |
Example |
| One-to-Many (1:*) |
One unique record relates to multiple records in another table. |
One customer has many sales transactions. |
| Many-to-One (*:1) |
Multiple records relate to one unique record in another table. |
Many sales rows relate to one product. |
| One-to-One (1:1) |
Each side has unique matching values. |
Two tables split attributes for the same unique entities. |
| Many-to-Many (*:*) |
Matching values can repeat on both sides. |
Complex mappings where neither side has unique keys. |
For a typical analytical model, a star schema is a strong starting point. Dimension tables contain descriptive attributes, while fact tables contain transactions or measurable events. Prefer one-to-many relationships from dimensions to facts when the data supports this design.
10.4 Common Relationship Problems
- Duplicate values in a column expected to be unique.
- Blank or null keys that do not match expected records.
- Different data types in related columns.
- Ambiguous filter paths between tables.
- Incorrect cross-filter direction.
- Relationships created using names instead of stable identifiers.
11. Building a Unified Sales Reporting Project
In this practical project, you will combine three data sources into a unified Power BI sales report.
11.1 Business Scenario
A retail organization wants to analyze revenue, products, customer behavior, and regional performance. The required information is stored in separate files and a database.
11.2 Source Data
| Source |
Table |
Important Columns |
| Excel |
Sales |
OrderID, OrderDate, CustomerID, ProductID, Quantity, SalesAmount |
| SQL Server |
Customers |
CustomerID, CustomerName, City, Region |
| CSV |
Products |
ProductID, ProductName, Category, UnitPrice |
11.3 Project Workflow
- Connect Power BI Desktop to the Excel sales file.
- Connect to SQL Server and load the Customers table.
- Connect to the product CSV file.
- Open Power Query Editor and inspect each query.
- Rename columns to use consistent business terminology.
- Set the appropriate data types.
- Remove unnecessary columns and handle invalid or missing values.
- Check that CustomerID and ProductID are represented consistently across tables.
- Decide whether to keep the tables separate or merge additional fields into Sales.
- For a star schema, load the fact and dimension tables separately and create relationships in Model view.
- Create a proper Date table for time-based analysis.
- Create DAX measures for revenue, quantity, and order count.
- Build report pages with cards, charts, and slicers.
- Validate the totals against the source files and database.
- Publish the report when it is ready and configure refresh where supported.
11.4 Recommended Model Structure
Customers
|
| CustomerID
|
Products --------- Sales --------- Date
ProductID OrderDate Date
Quantity
SalesAmount
In this example, Sales is the fact table. Customers, Products, and Date are dimension tables. Each dimension should have a suitable unique key for its relationship with Sales.
12. Creating DAX Measures for the Unified Report
After loading and modeling the data, create measures to calculate the business metrics displayed in the report. The following examples assume that the relevant tables and columns exist in the model.
12.1 Total Sales
Total Sales =
SUM ( Sales[SalesAmount] )
This measure adds the sales amounts in the current filter context.
12.2 Total Quantity Sold
Total Quantity =
SUM ( Sales[Quantity] )
This measure calculates the total quantity sold.
12.3 Total Orders
Total Orders =
DISTINCTCOUNT ( Sales[OrderID] )
This measure counts distinct order identifiers. It is useful when one order can contain multiple product lines.
12.4 Average Order Value
Average Order Value =
DIVIDE ( [Total Sales], [Total Orders], 0 )
This measure divides total sales by the number of distinct orders. The third argument provides a result of zero when the denominator is zero; use a blank result instead if that better suits the reporting requirements.
12.5 Year-to-Date Sales
Sales YTD =
TOTALYTD (
[Total Sales],
'Date'[Date]
)
This measure calculates sales from the beginning of the year through the current date in the filter context. It requires an appropriate Date table and a valid date relationship. Mark the Date table as a date table when required by the model's time-intelligence design.
12.6 Sales by Customer or Product
To analyze sales by customer or product, use the same Total Sales measure with CustomerName or ProductName on the visual axis. Correct relationships allow the dimension filters to affect the Sales fact table.
13. Designing the Unified Report
A unified report should present important metrics clearly and allow users to investigate the data at different levels.
13.1 Recommended Visuals
| Visual |
Purpose |
Suggested Fields |
| Card |
Display a high-level KPI. |
Total Sales |
| Card |
Show the total number of orders. |
Total Orders |
| Line Chart |
Show sales trends over time. |
Date and Total Sales |
| Bar Chart |
Compare sales across products. |
ProductName and Total Sales |
| Column Chart |
Compare sales across regions. |
Region and Total Sales |
| Donut Chart |
Show a suitable categorical breakdown. |
Category and Total Sales |
| Matrix |
Analyze multiple dimensions together. |
Region, Category, Total Sales |
| Slicer |
Filter report results interactively. |
Date, Region, Category |
13.2 Example Report Layout
---------------------------------------------------
| UNIFIED SALES PERFORMANCE |
---------------------------------------------------
| Total Sales | Total Orders | Average Order Value |
---------------------------------------------------
| Sales Trend by Month |
---------------------------------------------------
| Sales by Region | Sales by Product |
---------------------------------------------------
| Sales by Category | Customer Analysis |
---------------------------------------------------
| Date Slicer | Region Slicer | Category Slicer |
---------------------------------------------------
13.3 Report Design Best Practices
- Place the most important KPIs near the top of the report.
- Use consistent number formats, currency symbols, and date formats.
- Choose chart types that match the analytical question.
- Keep slicers organized and make their purpose clear.
- Use meaningful titles and descriptive labels.
- Verify visual interactions between charts and slicers.
- Avoid excessive colors, unnecessary decoration, and crowded layouts.
- Test the report at common screen sizes.
- Consider accessibility, including readable text and sufficient contrast.
14. Data Refresh and Maintenance
A unified report is useful only when its data remains sufficiently current. Refresh behavior depends on the storage mode, data source, credentials, gateway configuration, and Power BI environment.
14.1 Refreshing Data in Power BI Desktop
- Save the Power BI Desktop file.
- Select Home > Refresh.
- Wait for the queries and model to update.
- Review any refresh errors.
- Check key totals against the source data.
- Save the updated report.
14.2 Scheduled Refresh in Power BI Service
- Publish the report and semantic model to a workspace.
- Open the semantic model settings in Power BI Service.
- Configure data source credentials.
- Configure a gateway if required for on-premises or otherwise inaccessible sources.
- Set the refresh schedule according to business needs and available capacity.
- Check refresh history and resolve any errors.
14.3 Refresh Considerations
- Verify that file paths and source locations remain valid.
- Use credentials with appropriate permissions.
- Confirm that gateway connections are configured correctly where needed.
- Understand the difference between imported data refresh and DirectQuery behavior.
- Monitor refresh duration and failure notifications.
- Check whether upstream data changes affect column names or data types.
- Respect source system limits and organizational data policies.
15. Data Quality and Validation
Combining sources does not automatically guarantee accurate results. Data validation is essential to ensure that the integrated report reflects the intended business definitions.
15.1 Validation Checklist
- Compare record counts before and after transformations.
- Check for duplicate primary or business keys.
- Identify unmatched keys after merges or relationships.
- Validate date ranges and missing dates.
- Compare sales totals with the original source reports.
- Check for unexpected null values.
- Confirm that currency and unit conventions are consistent.
- Investigate changes in row counts after joins.
- Verify that filters produce expected results.
- Test totals at different levels, such as product, region, and month.
15.2 Reconciliation Example
Suppose the source sales file contains a total sales amount of 250,000. After loading the data into Power BI, the Total Sales measure should return the same amount under equivalent filters and business rules.
If Power BI displays 275,000, investigate possible duplicate rows, duplicated join keys, incorrect aggregation, or different filters. If Power BI displays 230,000, check for missing records, filtering steps, invalid values, and unmatched source records.
The objective is not simply to make totals match. Differences should be explained and resolved according to the correct business definition.
16. Common Problems and Troubleshooting
| Problem |
Possible Cause |
Solution |
| Data does not load |
Incorrect path, unavailable source, or insufficient permissions. |
Verify connectivity, credentials, file location, and access rights. |
| Merge returns null values |
Keys do not match because of data types, spaces, formatting, or missing identifiers. |
Standardize keys and investigate unmatched records. |
| Sales totals increase unexpectedly |
Duplicate matches in the lookup table or an incorrect join. |
Check key uniqueness, join type, and row counts. |
| Append creates null columns |
Source tables have different column names or structures. |
Standardize column names and review unmatched fields. |
| Relationship cannot be created |
Incompatible types or duplicate values on the expected one side. |
Correct data types and create a unique dimension key. |
| Visual shows the same value for every category |
Relationship is missing, inactive, or incorrectly configured. |
Inspect the model and validate filter propagation. |
| Refresh fails in Power BI Service |
Credentials, gateway, source path, or schema changes. |
Review refresh history and update the relevant settings. |
| Report is slow |
Large model, inefficient queries, complex measures, or slow source systems. |
Optimize the model, transformations, measures, and source queries. |
| Dates sort incorrectly |
Date values are stored as text or use inconsistent formats. |
Convert to proper date types and verify locale settings. |
| Duplicate customers appear |
Inconsistent customer records or repeated identifiers. |
Define a reliable customer key and apply documented data-quality rules. |
17. Performance Optimization Best Practices
- Load only required columns: Remove unused fields to reduce model size.
- Filter unnecessary rows: Limit the dataset when the business requirement permits.
- Prefer a star schema: Keep fact and dimension tables logically organized.
- Use appropriate data types: Avoid storing dates and numbers as text.
- Reduce unnecessary calculated columns: Use measures when a dynamic aggregation is appropriate.
- Preserve query folding when possible: Let supported sources perform transformations efficiently.
- Use stable identifiers: Avoid joining tables using names that can change or repeat.
- Review expensive merges: Check whether duplicate keys or large intermediate results are causing problems.
- Optimize DAX: Prefer clear, efficient measures and avoid unnecessary complexity.
- Choose storage modes carefully: Balance data freshness, source capacity, and report performance.
- Test realistic workloads: Evaluate performance using representative data and report interactions.
18. Security and Governance
Combining multiple sources can bring together sensitive information that was previously separated. Security must be considered throughout data integration and reporting.
- Use approved connectors and authorized source credentials.
- Apply least-privilege access to databases and files.
- Avoid exposing confidential fields that are not needed for reporting.
- Configure row-level security when users should see only permitted records.
- Validate security across related tables and cross-source models.
- Protect credentials and sensitive connection information.
- Use approved workspaces and sharing permissions.
- Follow organizational rules for retention, privacy, and data classification.
- Document source ownership, refresh frequency, and metric definitions.
Hiding a column in a report is not a security measure. Sensitive information should be protected using appropriate model design, permissions, and security controls.
19. Practical Exercises
Exercise 1: Combine Monthly Sales Files
Task: Import January, February, and March sales files into Power BI and append them into one table.
- Confirm that all files contain compatible columns.
- Standardize column names and data types.
- Append the three tables.
- Create a monthly sales chart.
- Validate the combined row count and sales totals.
Exercise 2: Enrich Sales with Customer Details
Task: Merge a sales table with a customer table using CustomerID.
- Check the CustomerID data type in both sources.
- Choose an appropriate join kind.
- Expand customer name and city columns.
- Identify sales records with no matching customer.
- Check whether the merge increased the number of sales rows.
Exercise 3: Build a Unified Sales Dashboard
Task: Create a report using sales, products, customers, and date information.
- Design a fact-and-dimension model.
- Create relationships using reliable keys.
- Build Total Sales, Total Orders, and Average Order Value measures.
- Add monthly trends and regional comparisons.
- Add date, region, and product category slicers.
- Validate totals and test all visual interactions.
Exercise 4: Investigate a Data Discrepancy
Task: The original sales source shows 500,000 in revenue, but the Power BI report shows 540,000.
- Compare source and model row counts.
- Check for duplicate keys in dimension tables.
- Inspect merge operations and relationship cardinality.
- Check measure definitions and filter context.
- Document the root cause and the correction.
20. Mini Project: Unified Retail Performance Report
Project Goal: Build a complete Power BI report that consolidates data from Excel, SQL Server, and CSV files.
Project Requirements
- Connect to at least three different data sources.
- Load sales, customers, and products.
- Clean inconsistent column names and data types.
- Append data if multiple sales files are provided.
- Merge data where a flattened table is genuinely required.
- Create relationships between fact and dimension tables.
- Create a proper Date table.
- Develop at least four meaningful DAX measures.
- Build a dashboard containing KPIs, trend analysis, and category comparisons.
- Add slicers for date, region, and product category.
- Validate source totals and unmatched records.
- Configure refresh and access settings where applicable.
Expected Deliverables
- A Power BI Desktop file (.pbix).
- A documented data model.
- A list of data sources and transformation steps.
- A dashboard with interactive visuals.
- A validation checklist with reconciled totals.
- A short explanation of the business insights discovered.
21. Interview Questions and Answers
Q1. What does combining multiple data sources mean in Power BI?
Answer: It means connecting to different systems or files and integrating their data into a common model or report for consolidated analysis.
Q2. What is Power Query?
Answer: Power Query is the data preparation engine used to connect to sources, clean data, transform tables, and combine information before loading it into the model.
Q3. What is the difference between Merge and Append?
Answer: Merge combines columns by matching rows using keys, while Append stacks rows from two or more tables.
Q4. What is the difference between Import and DirectQuery?
Answer: Import stores a copy of data in the semantic model and requires refresh to update that copy. DirectQuery queries a supported source as report interactions require data, so performance depends more directly on the source and query design.
Q5. Can Power BI connect to Excel and SQL Server in the same report?
Answer: Yes. Power BI can connect to both sources, load their data, and combine them using Power Query transformations or model relationships, subject to the selected storage modes and connector capabilities.
Q6. Why are relationships important?
Answer: Relationships allow filters and calculations to work across related tables without requiring all the data to be flattened into one table.
Q7. What is a star schema?
Answer: A star schema organizes a model around a central fact table connected to dimension tables. It generally improves clarity and supports effective analytical reporting.
Q8. What causes duplicate rows after a merge?
Answer: Duplicate matching keys in the joined table can produce multiple matches for a single source row. Inspect key uniqueness and the expected join behavior.
Q9. How can unmatched records be identified?
Answer: Use anti joins in Power Query, inspect nulls in merged columns, or create validation measures and tables to identify missing relationships.
Q10. What is query folding?
Answer: Query folding is the process of translating supported Power Query transformations into operations executed by the source system. It can improve refresh performance by reducing data transferred to Power BI.
Q11. How can data accuracy be verified?
Answer: Compare row counts and important totals against source systems, investigate duplicates and unmatched keys, and test results under equivalent filters and business rules.
Q12. What is a composite model?
Answer: A composite model combines supported storage modes or data-source patterns in one semantic model, enabling scenarios that use both imported and source-query data.
Q13. Why might a report refresh fail after publication?
Answer: Common reasons include expired credentials, unavailable sources, gateway issues, changed file paths, or schema changes.
Q14. How can a unified report be optimized?
Answer: Remove unused columns, use a suitable star schema, optimize transformations and DAX, choose appropriate storage modes, and test source queries and refresh performance.
Q15. Should all tables be merged into a single table?
Answer: No. Separate fact and dimension tables with appropriate relationships often provide a clearer and more maintainable model. Merge only when it serves a defined requirement.
22. Quick Revision Notes
- Power BI can connect to multiple files, databases, web sources, and supported cloud systems.
- Power Query is used for data cleaning, transformation, merging, and appending.
- Merge combines columns using matching keys.
- Append combines rows from multiple tables.
- Relationships connect tables through related fields.
- Use compatible data types and reliable identifiers.
- Prefer a star schema for many analytical reporting scenarios.
- Use DAX measures for aggregations and business calculations.
- Validate totals, row counts, duplicate keys, and unmatched records.
- Configure credentials, gateways, and refresh settings where required.
- Consider security, performance, and data governance throughout the process.
- A unified report should provide consistent metrics and meaningful business insights.
23. Final Checklist
- ☐ All required data sources are connected.
- ☐ Data types and column names are standardized.
- ☐ Missing values and duplicates have been investigated.
- ☐ Merge and append operations are appropriate and validated.
- ☐ Relationships and cardinality are correct.
- ☐ Measures return expected values.
- ☐ Visuals and slicers interact correctly.
- ☐ Source totals reconcile with report totals.
- ☐ Refresh and security settings are configured.
- ☐ The report is documented and ready for its intended audience.
24. Conclusion
Combining multiple data sources into a unified report is an essential Power BI skill. It enables analysts to bring together information from spreadsheets, databases, and other systems to produce a consistent view of business performance.
The most important skills are connecting to data sources, transforming data with Power Query, choosing correctly between merge and append, building reliable relationships, developing meaningful DAX measures, and validating results against the original data. A well-designed semantic model, supported by appropriate refresh, performance, and security practices, provides a dependable foundation for interactive business intelligence reports.
To learn more, explore the Microsoft Power BI Training course at JustAcademy or register for a course demo.