Lab Manual BA
Lab Manual BA
2
EX: 1 EXPLORE THE FEATURES OF MS-EXCEL.
Procedure:
Microsoft Excel is a powerful spreadsheet application that offers a wide range of features for data
analysis, visualization, and management. Here is an exploration of some key features of Excel:
Basic Features
1. Basic Formulas
- Arithmetic Operations: Addition (`+`), subtraction (`-`), multiplication (`*`), division (`/`).
- Cell References: Referencing other cells in formulas (e.g., `=A1+B1`).
2. Built-in Functions
- SUM, AVERAGE, COUNT, MAX, MIN: Basic statistical functions.
- IF: Conditional logic (`=IF(A1>10, "Yes", "No")`).
- VLOOKUP and HLOOKUP: Look up data in a table.
- INDEX and MATCH: More advanced lookups.
- TEXT Functions: CONCATENATE, LEFT, RIGHT, MID, TRIM, etc.
- DATE Functions: TODAY, NOW, DATE, YEAR, MONTH, DAY, etc.
3. Array Formulas
- Perform calculations on multiple values (e.g., `=SUM(A1:A10*B1:B10)`).
Data Analysis
3
2. Data Validation
- Ensure data integrity by restricting the type of data that can be entered in a cell.
4. What-If Analysis
- Scenario Manager: Create and save different scenarios for your data.
- Goal Seek: Find the input value needed to achieve a specific goal.
- Data Table: Analyze how changing certain values affects the results.
Visualization
2. Sparklines
- Small charts embedded in cells to show trends.
3. Conditional Formatting
- Highlight cells with specific colors, data bars, color scales, and icon sets based on their values.
Advanced Features
2. Power Query
- Import, clean, and transform data from various sources.
3. Power Pivot
- Create data models and perform powerful data analysis.
4
- Protect worksheets and workbooks with passwords.
- Set permissions for different users.
1. Templates
- Pre-built templates for common tasks (budgets, calendars, invoices).
2. Keyboard Shortcuts
- Enhance productivity with keyboard shortcuts (e.g., Ctrl+C for copy, Ctrl+V for paste).
3. Statistical Analysis
- Perform descriptive statistics, hypothesis testing, and regression analysis.
Result:
By exploring these features, you can harness the full power of Excel for data analysis, visualization, and
management. Excel's versatility makes it a valuable tool for a wide range of applications across different
fields.
5
2. (I)GET THE INPUT FROM USER AND PERFORM NUMERICAL OPERATIONS (MAX, MIN, AVG, SUM,
SQRT, ROUND)
Aim:
To Get the input from user and perform numerical operations (MAX, MIN, AVG, SUM, SQRT, ROUND)
using builtin functions in excel
Procedure:
Here are examples of how to perform basic numerical operations in Excel using formulas. The table
below lists the operation, formula, and an example for each.
Result : Thus formulas are applied directly in Excel to perform the respective numerical operations on
sample data.
6
2(II)PERFORM DATA IMPORT/EXPORT OPERATIONS FOR DIFFERENT FILE FORMATS.
Aim: To Perform data import/export operations for different file formats in Excel
Procedure:
Performing data import operations for different file formats in Excel involves using built-in features that
handle a variety of formats including CSV, TXT, XML, and other Excel workbooks.
a) Importing Data
1. Open Excel.
4. Browse to the location of your CSV file, select it, and click `Import`.
5. Review the data preview and click `Load` to import the data into Excel.
1. Open Excel.
5. In the Text Import Wizard, specify the file type (delimited or fixed width), delimiters, and other
settings.
6. Click `Finish` and choose where to place the data in your workbook.
1. Open Excel.
4. Browse to the location of your XML file, select it, and click `Import`.
7
5. Excel will parse the XML and allow you to load it into a worksheet.
1. Open Excel.
4. Browse to the Excel file you want to import data from, select it, and click `Import`.
5. In the Navigator pane, select the table or range you want to import.
For more advanced data import operations, you can use Power Query:
1. Open Excel.
3. Click `Get Data` and choose the appropriate source (e.g., `From File`, `From Database`, `From Web`).
4. Follow the prompts to connect to the data source and import the data.
5. Use the Power Query Editor to transform and clean the data as needed.
6. Click `Close & Load` to load the data into your workbook.
Result :
These steps cover the most common data import and export scenarios in Excel.
8
Xml to Excel
9
(II)Text to EXcel
10
11
12
13
2(III)PERFORM DATA EXPORT OPERATIONS FOR DIFFERENT FILE FORMATS.
Aim: To perform data export operations for different file formats in Excel
Procedure:
Performing data export operations for different file formats in Excel involves using built-in features that
handle a variety of formats including CSV, TXT, XML, and other Excel workbooks.
Exporting Data
6.Excel will prompt you with a warning about features not supported by CSV; click `Yes` to proceed.
4. In the `Save as type` dropdown, select `Text (Tab delimited) (*.txt)` or `CSV (Comma delimited)
(*.csv)`.
14
6. Excel will prompt you with a message about exporting XML; click `Continue` to proceed.
Result :
These steps cover the most common data export scenarios in Excel.
15
EX 3. PERFORM STATISTICAL OPERATIONS – MEAN, MEDIAN, MODE AND STANDARD DEVIATION,
VARIANCE, SKEWNESS, KURTOSIS
Aim:
To perform statistical operations – Mean, Median, Mode and Standard deviation, Variance, Skewness,
Kurtosis in excel
Procedure:
Excel provides various built-in functions to perform statistical operations like Mean, Median, Mode,
Standard Deviation, Variance, Skewness, and Kurtosis. By entering these formulas in any cell in Excel,
you can calculate the respective statistical measures for the data in the specified range (C1:C12) in this
case). Adjust the range as needed to fit your actual data.
1. Mean (Average): The sum of all data values divided by the number of values.
2. Median: The middle value of a data set when the values are arranged in ascending order.
16
4. Standard Deviation: A measure of the dispersion or spread of data values relative to the mean.
5.Variance: The average of the squared differences between each data value and the mean.
6.Skewness: A measure of the asymmetry of the data distribution around the mean.
7. Kurtosis: A measure of the "tailedness" or the sharpness of the data distribution relative to a normal
distribution.
Sample :
Result:
Thus , the statistical operations – Mean, Median, Mode and Standard deviation, Variance, Skewness,
Kurtosis are performed in excel
17
EX 4 : PERFORM Z-TEST, T-TEST & ANOVA
Procedure:
Performing statistical tests like Z-test, T-test, and ANOVA in Excel can be done using built-in functions
and the Data Analysis Toolpak.
(i) Z-test
A Z-test is used to determine if there is a significant difference between sample and population means
when the variance is known.
Steps to Perform a Z-test
1. Data Preparation:
- Suppose you have a sample data in column A (A2:A11).
- Population mean in cell G2.
- Population standard deviation in cell G3.
2. Use the `Z.TEST` function.
Formula:=Z.TEST(A2:A11, G2,G3)
Example:=Z.TEST(A2:A11, 19, 5.74)
(ii) T-test
A T-test is used to compare the means of two samples.
Steps to Perform a T-test
1.Data Preparation:
- Suppose you have two samples in columns A (A2:A11) and B (B2:B11).
2. Use the `T.TEST` function.
Formula: =T.TEST(A1:A10, B1:B10, tails, type)
- `tails`: 1 for a one-tailed test, 2 for a two-tailed test.
- `type`: 1 for paired, 2 for two-sample equal variance (homoscedastic), 3 for two-sample unequal
variance (heteroscedastic).
Example:
=T.TEST(A1:A10, B1:B10, 2, 2)
(iii)ANOVA
ANOVA (Analysis of Variance) is used to compare the means of three or more samples.
Steps to Perform ANOVA
1.Enable Data Analysis Toolpak:
- Go to `File` > `Options` > `Add-Ins`.
- In the `Manage` box, select `Excel Add-ins` and click `Go`.
- Check `Analysis ToolPak` and click `OK`.
2. Data Preparation:
- We have three samples in columns A (A2:A11), B (B2:B11), and C (C2:C11).
3. Perform ANOVA:
- Go to the `Data` tab.
- Click `Data Analysis` in the Analysis group.
- Select `ANOVA: Single Factor` and click `OK`.
- Enter the input range, select `Grouped by Columns`, check `Labels in First Row` if applicable, and
choose the output range.
Steps in Dialog:
- Input Range: `A2:C11`
18
- Grouped By: `Columns`
- Output Range: Select where you want the result to be displayed. Click `OK`.
- Excel will display the ANOVA table with the F-statistic and P-value.
Sample
Result:
Following the steps given above , Z-tests, T-tests, and ANOVA are performed in Excel to analyze the data
statistically
19
EX 5(I) : PERFORM DATA PRE-PROCESSING OPERATIONS I) HANDLING MISSING DATA
Aim: To Perform data pre-processing operations i) Handling Missing data ii) Normalization
Procedure:
Data preprocessing is crucial for preparing data for analysis, and Excel provides tools and functions to
handle common preprocessing tasks such as handling missing data and normalizing data.
20
Paste the mean value into the selected blank cells (Ctrl+V).
21
b) Imputing Missing Data with a Specific Value (e.g., Mean)
22
Result:
By following the above steps, missing data is handled and dataset in Excel is prepared for further
analysis.
23
EX 5(II) : PERFORM DATA PRE-PROCESSING OPERATION: NORMALIZATION
Aim: To Perform data pre-processing operation – Normalization in sample data set by using Excel
Procedure:
Data preprocessing is crucial for preparing data for analysis, and Excel provides tools and functions to
handle common preprocessing tasks such as handling missing data and normalizing data.
Normalization
Select a new column where you want to store the normalized values (e.g., B1).
In the first cell of this column (B1), enter the normalization formula
=(A1 - $C$1) / ($C$2 - $C$1)
Sample
24
Result: By following these steps, we can normalize our dataset in Excel, preparing it for further
analysis.
25
EX 6: PERFORM DIMENSIONALITY REDUCTION OPERATION USING PCA, KPCA & SVD
Aim: To Perform Performing dimensionality reduction operations such as PCA (Principal Component
Analysis), KPCA (Kernel PCA), and SVD (Singular Value Decomposition) using XLSTAT in Excel
Procedure:
Performing dimensionality reduction operations such as PCA (Principal Component Analysis), KPCA
(Kernel PCA), and SVD (Singular Value Decomposition) using XLSTAT in Excel is straightforward. XLSTAT is
a powerful add-on for Excel that provides a wide range of statistical and data analysis tools.
Prerequisites
Install XLSTAT:
- Ensure your data is arranged in a table format with variables in columns and observations in rows.
2. Open XLSTAT:
3. Access PCA:
- Click on `XLSTAT` > `Analyzing Data` > `PCA / Factorial analysis` > `Principal Component Analysis
(PCA)`.
4. Configure PCA:
- Specify any options relevant to your analysis, such as the number of components to extract.
5. Run PCA:
26
- XLSTAT will output the results, including eigenvalues, eigenvectors, and the scores of the principal
components.
2. Open XLSTAT:
3.Access KPCA:
- Click on `XLSTAT` > `Machine Learning` > `Dimensionality Reduction` > `Kernel PCA`.
4. Configure KPCA:
5. Run KPCA:
- XLSTAT will provide the transformed data and information about the kernel components.
2. Open XLSTAT:
3. Access SVD:
- Click on `XLSTAT` > `Machine Learning` > `Dimensionality Reduction` > `SVD`.
4. Configure SVD:
27
- Specify any options for the analysis, such as the number of singular values to compute.
5. Run SVD:
- XLSTAT will output the singular values, left singular vectors, and right singular vectors.
PCA Results
KPCA Results
SVD Results
Result:
By following these steps and using the powerful capabilities of XLSTAT, you can perform dimensionality
reduction on your datasets and better understand the underlying structure of your data.
28
EX NO: 7(I) PERFORM BIVARIATE ANALYSIS ON THE DATASET
Aim :
Bivariate analysis involves examining the relationship between two variables. In Excel, this can be done
in several simple ways, such as using scatter plots, calculating correlation coefficients, and using pivot
tables. Here's a step-by-step guide to perform bivariate analysis:
A. Scatter Plot
- Highlight the data range for the two variables, e.g., `B1:C6`.
- Click on `Scatter` in the Charts group and choose the first scatter plot option.
- Add chart elements like titles, axis labels, and a trendline by clicking on the chart and using the `Chart
Tools` options.
B. Correlation Coefficient
The correlation coefficient quantifies the strength and direction of the linear relationship between two
variables.
- Choose an empty cell where you want to display the correlation coefficient.
=CORREL(B2:B6, C2:C6)
- Press `Enter`.
29
3. Interpret the Result:
- A correlation coefficient (r) close to 1 or -1 indicates a strong linear relationship, while an r close to 0
indicates a weak relationship.
Pivot tables can summarize and analyze data, while pivot charts provide a visual representation.
- In the `Create PivotTable` dialog box, choose where you want the PivotTable report to be placed and
click `OK`.
- In the PivotTable Field List, drag `Feature1` to the `Rows` area and `Feature2` to the `Values` area.
- Ensure that `Feature2` is set to show values as `Sum` (default) or any other relevant aggregation.
ID Feature1 Feature2
1 10 20
2 15 25
3 20 30
4 25 35
5 30 40
Scatter Plot
30
- `Insert` tab > `Scatter` > First scatter plot option.
Correlation Coefficient
- E.g., D1.
3. Result:
- Assume the result is `1`, indicating a perfect positive linear relationship between `Feature1` and
`Feature2`.
- Select `A1:C6`.
Result:
By following these steps, you can perform bivariate analysis in Excel, gaining insights into the
relationship between two variables.
31
EX NO 7(II) PERFORM MULTIVARIATE ANALYSIS ON THE DATASET.
Procedure:
Multivariate analysis involves examining more than two variables to understand relationships and
patterns. In Excel, you can perform multivariate analysis using tools like multiple linear regression,
creating pivot tables, and visualizing data with charts. Here's a step-by-step guide to perform
multivariate analysis
Multiple linear regression analyzes the relationship between one dependent variable and two or more
independent variables.
3. Configure Regression:
- Input Y Range: Select the range for the dependent variable, e.g., `D1:D6` (Feature3).
- Input X Range: Select the range for the independent variables, e.g., `B1:C6` (Feature1 and Feature2).
- Output Range: Select where you want the output to be displayed, e.g., `E1`.
4. Run Regression:
32
- Excel will output the regression statistics, coefficients, and other relevant information.
Pivot tables and pivot charts can help summarize and visualize relationships between multiple variables.
- In the `Create PivotTable` dialog box, choose where you want the PivotTable report to be placed and
click `OK`.
A scatter plot matrix helps visualize the pairwise relationships between multiple variables.
- Unfortunately, Excel doesn’t have a built-in scatter plot matrix feature. However, you can use
multiple scatter plots to visualize the relationships.
33
Example Steps with the Dataset
Sample data:
- `File` > `Options` > `Add-Ins` > `Manage: Excel Add-ins` > `Go` > Check `Analysis ToolPak` > `OK`.
3. Configure Regression:
- Labels: Check.
4. Run Regression:
- Click `OK`.
- Select `A1:D6`.
34
- Drag `Feature1`, `Feature2`, `Feature3` to `Values`.
- Select the data for each pair of variables and create scatter plots:
- Add chart elements like titles and axis labels for clarity.
Results:
By following these steps, you can perform multivariate analysis on your dataset in Excel, helping you to
uncover relationships and patterns among multiple variables.
35
II Cycle – Power Bi Desktop
36
EX : 9 FEATURES OF POWER BI DESKTOP
Power BI Desktop is a robust business intelligence and data visualization tool that allows users to
connect to multiple data sources, transform and model data, create visual reports, and share insights.
Procedure :
1. Data Connectivity
- Wide Range of Data Sources: Power BI Desktop supports a variety of data sources including Excel, SQL
Server, Azure, Oracle, Google Analytics, Salesforce, and many more. Users can import data from on-
premises databases, cloud services, and flat files.
- Direct Query and Import Modes: Users can choose between importing data into Power BI or directly
querying the data source. Direct query allows for real-time data retrieval and interaction.
- Power Query Editor: This feature allows users to clean, transform, and shape data before using it in
reports. The editor provides a user-friendly interface for performing tasks like removing columns,
filtering rows, changing data types, merging queries, and creating custom columns.
- Automated Data Preparation: Power Query can automatically detect and suggest data transformations,
which simplifies the data preparation process.
3. Data Modeling
- Relationship Management: Power BI Desktop allows users to define and manage relationships between
different tables, enabling the creation of a comprehensive data model. This is done in the Model view,
where users can visually manage and create relationships.
- Calculated Columns and Measures: Using Data Analysis Expressions (DAX), users can create calculated
columns and measures to perform complex calculations and aggregations. DAX provides a powerful way
to create custom calculations tailored to specific business needs.
- Rich Formula Language: DAX includes functions for date and time handling, filtering and querying,
statistical and mathematical operations, and text manipulation. It enables the creation of advanced
calculations and business logic.
- Calculated Columns: These are new columns created in a table based on DAX formulas. They are useful
for adding new data derived from existing columns.
37
- Measures: Measures are calculations used in aggregations, such as sums, averages, minimums,
maximums, and counts. Measures are dynamic and recalculated based on the context of the data in
reports and visuals.
- Interactive Visualizations: Power BI Desktop provides a wide range of visualization types, including bar
charts, line charts, pie charts, scatter plots, maps, gauges, and tables. These visuals are interactive and
allow users to drill down into data, apply filters, and explore different dimensions of their data.
- Custom Visualizations: In addition to the built-in visuals, users can import custom visuals from the
Power BI marketplace or create their own using the Power BI Developer tools.
- Themes and Formatting: Users can apply themes to standardize the look and feel of reports. Power BI
also offers extensive formatting options to customize visuals, including colors, fonts, borders, and titles.
- Report Pages: Reports in Power BI Desktop can have multiple pages, allowing users to organize visuals
and insights in a structured way.
- Drill through and Cross-Filtering: Users can create drill through pages to provide detailed views and
insights on specific data points. Cross-filtering allows for interactive data exploration across different
visuals on the same report.
- Bookmarks: Bookmarks capture the current state of a report page, including filters and slicers, and
allow users to save and navigate to specific views and configurations easily.
- Publishing to Power BI Service: Users can publish their Power BI Desktop reports to the Power BI
Service, making them accessible online. This enables collaboration and sharing with others in the
organization.
- Shared Workspaces: Power BI Service provides shared workspaces where teams can collaborate on
datasets, reports, and dashboards.
- Row-Level Security: This feature allows administrators to define security roles and rules to control data
access at the row level, ensuring that users only see data relevant to them.
- Integration with Other Microsoft Products: Power BI seamlessly integrates with other Microsoft
products like Excel, Azure, Dynamics 365, and Teams. This integration enhances productivity and allows
for more comprehensive data analysis and reporting.
38
- APIs and SDKs: Power BI provides APIs and SDKs for developers to create custom solutions, embed
Power BI visuals in applications, and automate tasks.
- Power BI Mobile: The Power BI mobile app allows users to access reports and dashboards on mobile
devices, providing flexibility and accessibility on the go.
Results:
Power BI Desktop is a versatile and powerful tool for data analysis, visualization, and reporting. Its wide
range of features supports the entire data analysis process, from data preparation and modeling to
creating interactive reports and dashboards. Power BI's integration with other Microsoft tools and its
extensibility through APIs and custom visuals make it a valuable tool for organizations of all sizes.
39
EX NO 10: PREPARE & LOAD DATA
Procedure:
- Click "Connect".
- Browse to the location of your Excel file (e.g., `SalesData.xlsx`) and select it.
- Click "Open".
- In the Navigator window, you will see the available sheets in the Excel file. For example, assume the
file contains a sheet named `Sales`.
- Let's say your `Sales` data has columns: `Date`, `Product`, `SalesAmount`, and `Region`.
- Remove any unnecessary columns by selecting them, right-clicking, and choosing "Remove".
40
- Change the data type of `Date` column to Date if it’s not already in the correct format by selecting
the column, going to the "Transform" tab, and choosing "Date" from the Data Type dropdown.
- Ensure all other columns are in the correct data types (e.g., `SalesAmount` should be a decimal or
whole number).
3. Apply Changes:
- Once you've made the necessary transformations, click "Close & Apply" to apply the changes and
load the data back into Power BI.
1. Manage Relationships:
- If your dataset is simple and contained in one table, you might not need to create relationships.
- If you have multiple tables, go to the "Model" view by clicking on the "Model" icon on the left pane.
1. Create Visualizations:
- Go to the "Report" view by clicking on the "Report" icon on the left pane.
- Drag the `Product` field from the Fields pane to the Axis area of the Visualizations pane.
- Drag the `SalesAmount` field to the Values area. This will create a bar chart showing sales amounts by
product.
3.Add a Slicer:
- To add interactivity, you can add a slicer. Select the Slicer visualization from the Visualizations pane.
- Drag the `Region` field to the Field area in the slicer. This will allow you to filter the data by region.
4. Customize Visualizations:
- Click on the bar chart, go to the Format pane, and customize the appearance (e.g., change colors, add
data labels, set the title).
41
- Repeat the process to create other visualizations, such as pie charts, line graphs, and tables, to
represent different aspects of your data.
- Click on "File" and select "Save" to save your Power BI report as a `.pbix` file on your computer.
- To share your report, click on the "Home" tab and select "Publish".
- Choose the destination workspace where you want to publish the report.
Example Data
`SalesData.xlsx`
Result:
By following these steps, you can prepare, load, and visualize this sales data in Power BI to gain insights
into sales performance across different products and regions.
42
EX NO: 11 DEVELOP THE DATA MODEL
Aim:
Developing a data model in Power BI involves creating relationships between tables and structuring your
data in a way that supports your analysis and reporting needs. Let’s go through the steps to develop a
simple data model using an example scenario with multiple tables.
Procedure:
1.SalesData:
2. Products:
3. Regions:
2.Get Data:
- Click "Open".
3.Select Data:
- In the Navigator window, check the boxes next to the `SalesData`, `Products`, and `Regions` sheets.
43
- Click on "Transform Data" to open the Power Query Editor.
1. Go to Model View:
2. Create Relationships:
- Drag the `ProductID` field from the `SalesData` table to the `ProductID` field in the `Products` table.
- Drag the `RegionID` field from the `SalesData` table to the `RegionID` field in the `Regions` table.
3. Verify Relationships:
- Ensure the relationships are set correctly. The default setting is usually a one-to-many relationship,
which should be appropriate for this example.
- Make sure the cardinality (one-to-many or many-to-one) and cross-filter direction (single or both) are
set correctly.
1. Calculated Columns:
- You can create calculated columns if you need to derive new data points. For example, if you want to
calculate a "Total Sales" column.
- Go to the "Data" view by clicking on the "Data" icon on the left pane.
- Select the `SalesData` table, click on "Modeling" in the top menu, and choose "New Column".
2. Measures:
44
- Measures are used for calculations that are performed on aggregates (like SUM, AVERAGE).
1. Create Visualizations:
- Go to the "Report" view by clicking on the "Report" icon on the left pane.
- In the Visualizations pane, choose a visualization type, such as a bar chart, pie chart, or table.
- Drag the `ProductName` field from the `Products` table to the Axis area.
- Drag the `Total Sales Amount` measure to the Values area. This will create a bar chart showing total
sales amounts by product.
3. Add a Slicer:
- Drag the `RegionName` field from the `Regions` table to the Field area in the slicer. This will allow you
to filter the data by region.
4. Customize Visualizations:
- Click on the bar chart, go to the Format pane, and customize the appearance (e.g., change colors, add
data labels, set the title).
- Repeat the process to create other visualizations to represent different aspects of your data, like
sales trends over time or sales by category.
Relationships:
- `SalesData[ProductID]` to `Products[ProductID]`
- `SalesData[RegionID]` to `Regions[RegionID]`
45
- Click on "File" and select "Save" to save your Power BI report (.pbix file) on your computer.
- To share your report, click on the "Home" tab and select "Publish".
Result:
By following these steps, we can develop a data model in Power BI, create relationships between tables,
and build insightful visualizations based on the data.
46
EX 12: PERFORM DAX CALCULATIONS
Procedure:
DAX (Data Analysis Expressions) is a formula language used in Power BI for creating calculated columns,
measures, and custom tables. Here’s a step-by-step guide to performing DAX calculations in Power BI.
Example Scenario
1. SalesData:
o Columns: Date, ProductID, SalesAmount, RegionID
2. Products:
o Columns: ProductID, ProductName, Category
3. Regions:
o Columns: RegionID, RegionName
Step-by-Step Guide
1. Go to Data View:
o Click on the "Data" icon on the left pane to enter the Data view.
2. Create a New Calculated Column:
o Select the SalesData table.
o Click on "Modeling" in the top menu and select "New Column".
3. Enter DAX Formula:
o Enter a DAX formula for your new calculated column. For example, to create a column
that categorizes sales amounts, use the following DAX formula:
DAX
SalesCategory = IF(SalesData[SalesAmount] > 200, "High", "Low")
4. Press Enter:
o Press Enter to create the column. The new column SalesCategory will be added to the
SalesData table.
47
1. Create a New Measure:
o In the same "Modeling" tab, click "New Measure".
2. Enter DAX Formula for Measure:
Enter a DAX formula for the measure. For example, to calculate the total sales amount,
use the following DAX formula:
Press Enter to create the measure. The measure Total Sales Amount will appear in the
Fields pane under the SalesData table.
1. Go to Report View:
o Click on the "Report" icon on the left pane to enter the Report view.
2. Create a Visualization:
o In the Visualizations pane, choose a visualization type, such as a bar chart.
3. Add Fields to Visualization:
o Drag the ProductName field from the Products table to the Axis area.
o Drag the Total Sales Amount measure to the Values area.
4. Create Additional Visualizations:
o Use the calculated columns and measures to create other visualizations, like pie charts,
line graphs, and tables.
Sum of a Column
Average of a Column
Count of Rows
Conditional Calculation
Year-to-Date Calculation
48
Example Advanced Calculations
Sales Growth =
DIVIDE(
(SUM(SalesData[SalesAmount]) - CALCULATE(SUM(SalesData[SalesAmount]),
DATEADD(SalesData[Date], -1, YEAR))),
AVERAGEX(
Result:
By following these steps, we can perform various DAX calculations in Power BI to enhance data
analysis and reporting capabilities.
49
EX 13: DESIGNING A REPORT IN POWER BI
Aim: To create a comprehensive and interactive report in Power BI. Experiment with different
visualizations and formatting options to enhance your data presentation.
Procedure:
2. Familiarize yourself with the Power BI interface, including the Ribbon, Fields pane, Visualizations
pane, and Report canvas.
2. Select **Get Data** > **Choose the data source** (e.g., Excel, SQL Server, etc.).
4. In the Navigator window, select the tables or sheets you want to load.
3. Use the tools in the Power Query Editor to clean and transform your data:
- Filter rows
- Rename columns
50
2. Select the type of visual you want to create from the Visualizations pane (e.g., bar chart, line chart, pie
chart).
3. Drag and drop fields from the Fields pane to the appropriate areas in the Visualizations pane (e.g.,
Axis, Values, Legend).
4. Customize the visual using the formatting options in the Visualizations pane.
1. Add multiple visuals to your report canvas by repeating the steps in Step 4.
5. Choose the workspace where you want to publish the report and click **Select**.
51
3. Click on the report to open it.
4. Click on **Share** to distribute your report with others by entering their email addresses.
Best Practices
Result:
By following these steps, We have created a comprehensive and interactive report in Power BI and
Experimented with different visualizations and formatting options to enhance data presentation.
52
EX NO: 14 CREATE A DASHBOARD AND PERFORM DATA ANALYSIS
Aim:
Creating a dashboard and performing data analysis using Power BI involves several steps, from data
import and transformation to visualization and sharing the dashboard. Below is a comprehensive guide
to help you create a Power BI dashboard and perform data analysis.
Procedure:
2. Familiarize yourself with the interface, including the Ribbon, Fields pane, Visualizations pane, and
Report canvas.
2. Select **Get Data** > Choose the data source (e.g., Excel, SQL Server, etc.).
4. In the Navigator window, select the tables or sheets you want to load.
3. Use the tools in the Power Query Editor to clean and transform your data:
- Filter rows
- Rename columns
53
Step 4: Data Analysis
1. Understand the data: Explore the imported data to understand its structure and content.
2. Identify key metrics and dimensions: Determine which metrics (e.g., sales, profit) and dimensions
(e.g., date, region) are important for your analysis.
3. Create calculated columns and measures: Use DAX (Data Analysis Expressions) to create new
calculated columns and measures that can help in your analysis.
2. Select the type of visual you want to create from the Visualizations pane (e.g., bar chart, line chart, pie
chart).
3. Drag and drop fields from the Fields pane to the appropriate areas in the Visualizations pane (e.g.,
Axis, Values, Legend).
4. Customize the visual using the formatting options in the Visualizations pane.
1. Add multiple visuals to your report canvas by repeating the steps in Step 5.
54
2. Click on the **Home tab.**
5. Choose the workspace where you want to publish the report and click **Select**.
4. Click on **Share** to distribute your dashboard with others by entering their email addresses.
Data Source
- An Excel file containing sales data with columns for Date, Region, Product, Sales Amount, and Profit.
Visualizations
Result:
By following these steps, we can create a comprehensive and interactive dashboard in Power BI that
provides valuable insights into your data. Experiment with different visualizations and formatting
options to enhance your data presentation.
55
EX NO 15 : CASE STUDY PRESENTATION USING POWER BI
Aim:
To analyze and visualize the performance of employees in an organization using Power BI, focusing on
key metrics such as employee satisfaction, performance ratings, training hours, and attendance records.
Procedure:
Data Source
- Data Columns: Employee ID, Name, Department, Job Title, Performance Rating, Satisfaction Score,
Training Hours, Absence Days
Step-by-Step Process
3. Load Data: Navigate to your Excel file, select it, and click Open. In the Navigator window, select the
relevant tables or sheets and click Load.
2. Clean Data: Perform necessary data transformations, such as removing unnecessary columns, filtering
rows, renaming columns, and changing data types.
3.Close & Apply: After making the necessary transformations, click Close & Apply.
1. Calculated Columns: Create new calculated columns if needed using DAX (Data Analysis Expressions).
2. Measures: Define measures for key metrics such as Average Performance Rating and Average
Satisfaction Score.
DAX
56
Average Satisfaction Score = AVERAGE(Employee[Satisfaction Score])
- Drag Date to the Trend axis field (if date data is available).
- Drag relevant columns (Employee ID, Name, Department, Job Title, Performance Rating, Satisfaction
Score, Training Hours, Absence Days) to the Values field.
1. Arrange Visuals: Place the created visuals on the canvas for a coherent layout.
2. Format Visuals: Use the formatting options to add titles, labels, and adjust colors and themes.
57
3. Add Slicers: Insert slicers for interactive filtering. For example, add slicers for Department and Job
Title to allow users to filter the data dynamically.
1.Text Boxes: Click on Insert > Text box to add descriptive text and explanations to your dashboard.
1. Save the Report: Click on File > Save As to save your Power BI report.
2. Publish: Click on Home > Publish > Publish to Power BI. Sign in to your Power BI account, choose the
workspace, and click Select.
3. Share: Click on Share to distribute the dashboard by entering email addresses or generating a
shareable link.
4. Dashboard Analysis
- Average Performance Rating by Department: Identify which departments have the highest and lowest
performance ratings.
- Satisfaction Score Trend Over Time: Observe the trend in employee satisfaction and identify any
patterns or significant changes.
-Training Hours Distribution by Department: Determine which departments are receiving the most
training and their training hours distribution.
- Average Satisfaction Score KPI: Monitor the overall employee satisfaction with a quick glance.
- Detailed Employee Data Table: Provide a detailed view of employee data for in-depth analysis.
5. Conclusion
This case study demonstrated how to utilize Power BI to analyze and visualize employee performance
data effectively. By following the outlined steps, we can create an interactive and insightful dashboard
that helps in making informed decisions related to employee management and performance
improvement.
58
EX NO 15 : CASE STUDY PRESENTATION USING POWER BI
Aim:
To analyze and visualize the performance of employees in an organization using Power BI, focusing on
key metrics such as employee satisfaction, performance ratings, training hours, and attendance records.
Procedure:
Data Source
- Data Columns: Employee ID, Name, Department, Job Title, Performance Rating, Satisfaction Score,
Training Hours, Absence Days
Step-by-Step Process
3. Load Data: Navigate to your Excel file, select it, and click Open. In the Navigator window, select the
relevant tables or sheets and click Load.
2. Clean Data: Perform necessary data transformations, such as removing unnecessary columns, filtering
rows, renaming columns, and changing data types.
3.Close & Apply: After making the necessary transformations, click Close & Apply.
1. Calculated Columns: Create new calculated columns if needed using DAX (Data Analysis Expressions).
2. Measures: Define measures for key metrics such as Average Performance Rating and Average
Satisfaction Score.
59
- Drag Department to the Axis field.
- Drag Date to the Trend axis field (if date data is available).
- Drag relevant columns (Employee ID, Name, Department, Job Title, Performance Rating, Satisfaction
Score, Training Hours, Absence Days) to the Values field.
1. Arrange Visuals: Place the created visuals on the canvas for a coherent layout.
2. Format Visuals: Use the formatting options to add titles, labels, and adjust colors and themes.
3. Add Slicers: Insert slicers for interactive filtering. For example, add slicers for Department and Job
Title to allow users to filter the data dynamically.
1.Text Boxes: Click on Insert > Text box to add descriptive text and explanations to your dashboard.
1. Save the Report: Click on File > Save As to save your Power BI report.
60
2. Publish: Click on Home > Publish > Publish to Power BI. Sign in to your Power BI account, choose the
workspace, and click Select.
3. Share: Click on Share to distribute the dashboard by entering email addresses or generating a
shareable link.
4. Dashboard Analysis
- Average Performance Rating by Department: Identify which departments have the highest and lowest
performance ratings.
- Satisfaction Score Trend Over Time: Observe the trend in employee satisfaction and identify any
patterns or significant changes.
-Training Hours Distribution by Department: Determine which departments are receiving the most
training and their training hours distribution.
- Average Satisfaction Score KPI: Monitor the overall employee satisfaction with a quick glance.
- Detailed Employee Data Table: Provide a detailed view of employee data for in-depth analysis.
Conclusion
This case study demonstrated how to utilize Power BI to analyze and visualize employee performance
data effectively. By following the outlined steps, we can create an interactive and insightful dashboard
that helps in making informed decisions related to employee management and performance
improvement.
61
EX NO 15 : CASE STUDY PRESENTATION USING POWER BI
Aim:
The goal of this case study is to analyze the performance of a company’s sales and marketing efforts.
The analysis will focus on understanding sales trends, customer segmentation, campaign effectiveness,
and regional performance. This analysis will help the company identify key areas of improvement and
make data-driven decisions to enhance overall business performance.
Procedure :
Data Sources
4. Customer Segmentation: Analysis of customer demographics such as age, income, and location.
7. Customer Lifetime Value (CLTV): The predicted revenue from a customer over the entire relationship.
8. Return on Investment (ROI) for Campaigns: The ROI for each marketing campaign.
62
- Import the data from `SalesData.xlsx`, `CustomerData.xlsx`, `MarketingCampaigns.xlsx`,
`ProductData.xlsx`, and `Regions.xlsx`.
2. Transform Data:
- Clean and transform the data, such as ensuring proper data types and removing any unnecessary
columns.
- Combine relevant tables where necessary (e.g., linking `SalesData` with `CustomerData` using
Customer ID).
3. Create Relationships:
- `SalesData[ProductID]` to `ProductData[ProductID]`
- `SalesData[CustomerID]` to `CustomerData[CustomerID]`
- `SalesData[RegionID]` to `Regions[RegionID]`
- `SalesData[CampaignID]` to `MarketingCampaigns[CampaignID]`
4. Campaign ROI:
```
63
Step 3: Visualizations
- Sales Trends Over Time: Display as a line chart showing monthly and yearly sales trends.
- Customer Segmentation: Display as a pie chart showing the distribution of customers by age group,
income level, etc.
- Customer Lifetime Value (CLTV): Display as a bar chart segmented by customer demographics.
- Campaign Effectiveness: Display as a stacked bar chart showing sales attributed to each marketing
campaign.
- Sales by Region Over Time: Display as a line chart to show trends in different regions.
- Products that contribute the most to revenue can be prioritized for marketing and sales efforts.
- Regions with lower sales might require targeted campaigns or investigation into market challenges.
3. Customer Segmentation:
64
- Tailor marketing strategies to target high-value customer segments identified in the customer
segmentation analysis.
- Discontinue or optimize campaigns with low ROI and invest more in high-performing campaigns.
- Use trend analysis to forecast future sales and adjust inventory and marketing strategies accordingly.
1. Introduction:
2. Data Overview:
3. Key Findings:
4. Dashboard Walkthrough:
5. Recommendations:
6. Conclusion:
- Publish the report to the Power BI Service for sharing with stakeholders.
65
Conclusion
By following this case study, you can demonstrate how Power BI can be used to perform a
comprehensive analysis of sales and marketing performance, leading to data-driven decision-making
and improved business outcomes.
66