Data Analytics Cheat Sheet
Data Analytics Cheat Sheet
Cheat Sheet
Content
• Data Analytics
• Data Analytics Everyday Example
• Why Data Analytics?
• Workflow of Data Analytics
Data Analytics
Process of Finding Meaning Insights.
• Draw Conclusions
• Make Predictions
• Derive Informed Decision Making
Data Analytics is the science of analyzing raw data to make conclusions about that information.
Data Analytics help a business optimize its performance, perform more efficiently, maximize profit,
or make more strategically-guided decisions.
Recommended Videos
• YouTube recommends videos based on our past searches, watch time, number of likes.
• YouTube will recommend similar videos further.
Google Maps
Google Maps recommends the routes based on traffic conditions and transport mode.
Workflow
Workflow is a series of steps that need to be completed in a specific to achieve a goal or objective.
Workflow of Data Analytics
• Problem Definition
• Data Collection
• Data Wrangling
• Modelling
• Data Visualization
Problem Definition
Clearly defining the business problem or question that needs to be answered.
Data Collection
Data Collection is the process of gathering relevant information or data from various sources.
Data Wrangling
It is the process of cleaning raw data in preparation for analysis. It involves identifying and
resolving mistakes, filling in missing data, and organising and transferring it into an easily
understandable format.
Modelling
A Data Model is a way of organizing and structuring data so that it can be easily understood.
Data Visualization
Data Visualization is the process of generating graphical representations of data for various
purposes.
Model
• Data modeling is the process of determining how your tables are related to each other.
Visualize
• The visualization task is where you get to bring your data to life.
Analyze
• The analyzing task is an important step of understanding and interpreting the information
that is displayed on the report.
Manage
• The management of your content helps to strengthen collaboration between teams and
individuals.
Data Analyst
• Primarily focuses on analyzing and interpreting data.
• A Data Analyst answers questions about present trends.
Data Scientist
• Finds patterns in the data and answers the questions about future (Predictions).
• Uses Machine Learning and Deep Learning technologies to solve business problems.
This helps them serve just the right shows to their consumers.
• They retain up to 93% of their Consumers Using Data Analytics.
• They even have plans to create different trailers for different audiences.
Predictive Maintenance
• Which is essentially being able to determine when there might be a fault with an aircraft
ahead of time. By analyzing data on factors like:
• Equipment usage
• Temperature
• Vibration and other parameters
• It helps them to identify patterns and anomalies that may indicate when equipment is likely
to fail or requires maintenance.
Fuel Optimization
• Qantas Airways does predictive maintenance using "FlightPulse" software.
Note:
"FlightPulse" is a software platform that provides data analytics and business intelligence
solutions for the aviation industry, helping airlines optimize their operations and improve their
profitability.
• This helps its pilots fly more efficiently and reduces fuel usage and emissions.
Introduction of Power BI | Cheat Sheet
Content
• Introduction
• Significance of Power BI
• Companies which use Power BI
• Power BI Products
1. Introduction
• Power BI is an interactive data visualization software product developed by Microsoft.
• BI in Power BI stands for Business Intelligence (BI).
• Power BI is a tool that helps you turn data into meaningful insights.
• Power BI offers a range of data visualization tools, including charts, graphs, tables, and
maps, and allows users to create custom visuals.
• BI allows organizations to collect data from various sources, such as databases, spreadsheets
and enterprise applications and turn that into actionable insights.
• power BI is consistently ranked as a leader in the BI market by independent research firms
like 'Garther' and 'Forrester'.
2. Significance of Power BI
• Easy to use: Power BI has an intuitive and user-friendly interface that allows users to easily
connect to different data sources, build data models, and create compelling visualizations.
• Powerful analytics: Power BI provides advanced analytics capabilities, such as forecasting,
clustering, and trend analysis, that allow users to gain insights and make predictions from
their data.
• Seamless integration: Power BI integrates seamlessly with other Microsoft tools, such as
Excel and SharePoint, as well as other third-party tools, making it easier to work with data
across different platforms.
• Scalability: Power BI is a scalable tool that can handle large volumes of data and support
multiple users, making it suitable for businesses of all sizes.
• Collaboration: Power BI allows users to collaborate with each other by sharing reports,
dashboards, and data models, enabling teams to work more efficiently and effectively.
• Financial Services: Uses Power BI to gain insights into customer behavior, market trends
and risk analysis.
• Retail: Uses to track sales performance, inventory management and customer buying
patterns to optimize pricing and promotional strategies.
• Healthcare: Healthcare providers use Power BI to track patient outcomes, manage costs and
analyze healthcare data to improve treatment plans.
• Manufacturing: Manufacturers use Power BI to track production performance, inventory
management and quality control.
• Education: Uses to track student performance, analyze course data and identify trends in
enrollment to improve their educational programs.
• Government: Government agencies use Power BI to track and analyze data related to
public health, transportation and social services to improve public policy decisions.
4. Power BI Products
Power BI Desktop
• Windows desktop application is known as Power BI Desktop.
Power BI Service
• Power BI Service is a web version of PowerBI.
• It is a cloud-based platform provided by Microsoft.
• It allows users to publish their Power BI reports and dashboards to the cloud, where they can
be accessed, viewed and interacted by others.
Power BI Mobile apps
• Power BI Mobile apps for Windows, iOS, and Android devices.
• It is a mobile version of Power BI that allows users to access their reports and dashboards on
the go from their smartphones or tablets.
Content
• Download and Install Power BI Desktop
• Minimum system requirements
Power BI Desktop only works on Windows operating system and is not compatible with Mac
OS or Ubuntu.
Quick Tip:
You can either Start from step 1 or click Here and start at step 4
Step 1: Open your browser and search Power BI.
• Step 2: Go to Products Drop Down and select Power BI Desktop
.
Content
• Exploring Power BI
• Building Blocks of Power BI
1. Exploring Power BI
Ribbons
Ribbon in Power BI is a user interface element that provides easy access to the various tools and
features in the application.
Views
In Power BI, there are three main views.
• Report View:
• This is the default view that you will see when you open a report in Power BI.
• In this view, you can design and create your report by adding and arranging
visualizations, formatting the layout and appearance of the report.
• Data View:
• This view allows you to see and modify the data that is being used in your report.
• In this view, you can work with the data tables and fields, modify data types and
formats, and create calculated columns and measures.
• Model view:
• In this view, you can manage the relationships between different tables and data
sources.
• This view is useful for more advanced data modeling tasks.
Visualization pane
• The Visualization pane is located on the right side of the Power BI Desktop interface, it
contains different visuals(graphs) header that you can use to display your data.
• The Visualization pane includes various types of visualizations, such as tables, matrices,
cards, and maps.
• It also allows you to add fields to the various areas of the visualization, such as the Axis,
Legend, and Values.
Pages Tab
• Pages tab can be found at the bottom of the page.
• It allows you to navigate between pages, add, select, remove the report page.
• Also, you can create a duplicate report page from here.
Canvas
• Canvas is a single page, in report view.
• It is the main workspace in Power BI Desktop where you create and design your reports.
Visualization
Visualization is the represenatation of data in a graphical form.
Datasets:
A dataset is a collection of data or information that is organised and presented in a structured
format. It can include various types of data, such as numbers, text, and images.
Reports:
Reports is a collection of visualizations, tables and other visual elements that are arranged on one or
more pages to provide a visual represenation of data insights.
Dashboards:
Power BI dashboard is a collection of data visualizations, reports and other elements that provide an
overview of business metrics
Dashboards vs Reports:
Item Dashboards Reports
Pages Dashboards are created only on one page Can be created in one or more pages
Dashboards are created from multiple
Data Sources Reports are created from a single dataset
datasets or reports
Dashboards always concentrate on Reports are not concentrated on the
Visualization building insights into the data by using visualization part of the data rather it
graphs ,visuals , charts, etc. looks to create summary pages
Tiles:
Tiles is a single visualization or visual in a report or on a dashboard.
Project Overview | Cheat Sheet
Content
• Project Overview
• Problem Statement
• Objective
• Significance of Supermarket Sales Data
Project Overview
Realmart is planning to start a new Supermarket in another city. To do so, analytics needs to be
performed for the existing branches. The project involves analyzing sales data of realmart stores
having branches across other cities.
Problem Statement
The challenge is to analyze this data effectively and create a report that provides actionable insights
and recommendations for the new branch. For example, we took existing data such as customers,
products, quantity, tax, payment, rating, profit, etc. Based on this report, Realmart will open their
new branch.
Objective
The objective of the project is to build a report that provides insights, helps the company to make
more informed decisions, and improves its performance.
• Dataset
• Columns in the Dataset
Dataset
• A dataset is a collection of data or information that is organised and presented in a structured
format.
• It can include various types of data, such as numbers, text and images.
• Datasets are important because they allow us to collect, organise and analyse large amounts
of data in a structured and meaningful way.
• Datasets are used to study trends or patterns in the data.
• Data sets are a critical component of Power BI, as they provide the foundation for creating
insightful reports and visualisations.
• Once a dataset is created, it can be analysed using various techniques to extract insights and
gain a better understanding of the data.
In the Realmart sales dataset, The following are the column names.
• Invoice ID: A unique identifier for each sales transaction in the supermarket.
• Branch: The branch of the supermarket where the transaction took place (there are three
branches - A, B, and C).
• City: The city in which the branch is located.
• Customer type: Whether the customer is a member or a non-member.
• Gender: The gender of the customer making the purchase.
• Product line: The type of product being purchased (e.g., fashion accessories, sports and
travel, food and beverages, etc.).
• Unit price: The price of one unit of the product.
• Quantity: The number of units of the product being purchased.
• Tax 5%: The amount of tax (5% of the total cost) charged on the purchase.
• Total: The total cost of the purchase (including the unit price, quantity, and tax).
• Total = Unit price * Quantity + Tax 5%
• Date: The date on which the purchase was made.
• Time: The time of day at which the purchase was made.
• Payment: The method of payment used for the purchase (cash, credit card, or e-wallet).
• COGS: Cost of goods sold, which is the direct cost of producing the product or service that
was sold.
• COGS = Total - Tax 5%
• Gross margin percentage: The percentage of revenue that represents gross profit after
deducting the cost of goods sold.
• Gross margin percentage = (gross income / Total) * 100
• Gross income: The amount of gross profit made from the sale.
• Gross income = Total - COGS
• Rating: The customer's rating of their shopping experience (on a scale of 1 to 10).
By understanding the columns in the dataset, we can determine which variables are relevant to our
analysis.
Note:
Given dataset is already organised and made ready for creating a report in Power BI Desktop.
Introduction
• Power BI is a powerful data visualisation tool that allows users to create interactive reports
and dashboards using data from various sources.
• Importing data into Power BI is the first and most critical step in building any data
visualisation or business intelligence solution.
• Power BI supports various Data sources to connect and import data from, including Excel
files, text/CSV files, databases cloud services and more.
• Step 3: Browse and select the Excel workbook you want to import.
Content
• Canvas
• Adjusting the Canvas
• Title
• Adding Titles
Canvas
In Power BI, The canvas is the main workspace where you design and build your reports or
dashboards. It's the area where you place visuals, tables, charts and other elements to create your
data presentation.
The canvas is a blank area that you can customize according to your needs. You can add new pages,
change the size of the canvas, adjust the background color and more.
When you add a visual to the canvas, you can use the fields pane to define its properties, such as the
data source, type of visualization and formatting. You can also apply filters, create hierarchies and
drill down or up to get insights from your data.
Title
In Power BI, the title is a text box that appears at the top of a report. The title can be used to provide
a brief description or summary of the content that is being displayed.
The title can be added to a report page or a visualization by selecting the
"Text box"
option and dragging it to the desired location. Once the text box is added, you can edit the text to
create the title.
Adding Titles
1. Click on Home in Ribbon.
2. Click on Text box.
3. Add title in the text box that appears on canvas. you can format your title such as Font,
Color, Style etc of your title
4.Go to the
Format
, Here you can change or add background color, border, height and width of titles.
Content
• Card
• When to use a Card
• How to add a Card
• How to Customize a Card
Card
• Card is a visual tool used to display
key performance indicators (KPIs)
and other metrics in a concise and easy to understand format.
• Card can helps users monitor progress towards specific goals and objectives and quickly
identify areas that require attention or improvement.
When to use a Card
• Card are particularly useful when the focus is on a specific KPI or metric that is critical to
the organization's success.
• They help users quickly identify areas of strength and weakness, and can be used to drive
action and improve performance.
Step 2: Add the data by drag and drop onto the "Fields" section in the Visualizations pane.
How to Customize a Card
Click on the card you want to customize.
In the Visualizations pane, click on the
“Format your visual”
to access the formatting options for the selected card.
Callout Value: you can change the Font, Size, Color and Display Unit of value.
Category Label: you can change the Font, Size and Color of the label.
Adding a Bar Chart | Cheat Sheet
Content
• Bar Chart
• When to use a Bar Chart
• How to add a Bar Bhart
• How to customize a Bar Chart
Bar Chart
A bar chart in Power BI is a type of visualization that displays data using rectangular bars, where
the length of each bar is proportional to the value it represents. The x-axis displays categories or
groups being compared, while the y-axis represents the values being measured.
In Power BI, there are 6 types of bar and column charts.
• Stacked Bar Chart
• Stacked Column Chart
• Clustered Bar Chart
• Clustered Column Chart
• 100% Stacked Bar Chart
• 100% Stacked Column Chart
• Stacked Bar Chart: This chart type is similar to the stacked column chart, but the bars are
displayed horizontally instead of vertically. It is useful for comparing the composition of
each category or group.
• Stacked Column Chart: This chart type divides each column into segments representing
different values, allowing you to see the total value for each category as well as the value for
each segment.
• Clustered Bar Chart: This chart type is similar to the clustered column chart, but the bars
are displayed horizontally instead of vertically. It is useful for comparing values across
categories or groups.
• Clustered Column Chart: This chart type displays columns side-by-side, making it easy to
compare values across categories or groups.
• 100% Stacked Bar Chart: This chart type is similar to the 100% stacked column chart, but
the bars are displayed horizontally instead of vertically. Each bar represents 100% of the
data, making it easier to compare the proportion of each value across categories.
• 100% Stacked Column Chart: This chart type is similar to a stacked column chart, but
each column represents 100% of the data, making it easier to compare the proportion of each
value across categories.
Note: A bar chart displays the data horizontally, with the bars extending along the y-axis, while a
column chart displays the data vertically, with the columns extending along the x-axis.
• Drag and drop the fields you want to use for the x-axis and y-axis into the respective fields
on the "Values" and "Axis" sections of the "Visualizations" pane.
How to customize a Bar Chart.
• Click on the bar chart visual to select it.
• Use the options under the "Visualizations" pane to customize the chart, such as changing the
color of the bars, adjusting the font size, or adding a title to the chart.
• In the Visualizations pane, click on the “Format your visual” to access the formatting
options for the selected bar chart.
Use the available formatting options to customize the chart's appearance. These options include:
Axis settings: You can change the minimum and maximum values for the axis, adjust the tick
marks and labels, value font and color and add a secondary axis.
Legend settings: You can change
the position and orientation of the legend, adjust the font size, color, turn the legend on or off and
add title text.
Data label settings: You can show or hide the data labels, adjust the position, orientation and font
size of the labels.
Columns: you can change the colors of the columns and spacing(inner padding) of the columns.
Adding a Line Chart | Cheat Sheet
Content
• Line Chart
• When to use a Line Chart
• How to add a Line chart
• How to customize a Line Chart
• Area Chart
Line Chart
A line chart in Power BI is a type of data visualization that displays information as a series of data
points connected by straight line segments. It is commonly used to show trends over time or to
compare the relationship between two variables.
In a line chart, the x-axis typically represents time or some other continuous variable, while the y-
axis displays the value of the variable being measured. Each data point is represented by a dot or
other shape, and these are connected by straight lines to show the trend over time or across the
variable being measured.
Line charts in Power BI can be customized with different colors, shapes, and sizes of data points, as
well as the appearance of the lines connecting the data points. They can also include axis titles, data
labels, legends, and other features to help interpret the data.
Step 3: Drag and drop the field(s) you want to use for the x-axis and y-axis onto the "Axis" and
"Values" sections of the "Visualizations" pane.
How to customize a Line Chart.
You can customize a Line Chart in Power BI in several ways. Here are the steps to customize a Line
Chart:
Select the Line Chart visual that you want to customize.
Click on the "Format your visual" icon from the "Visualizations" pane on the right-hand side of the
screen.
Customize the Line Chart by using the various formatting options available in the "Format" pane.
Some of the common formatting options include:
Lines: You can customize the lines in a Line Chart by changing the line color, thickness, and style.
To do this, select the Line Chart visual, go to the "Visualizations" pane, and click on the "Format"
icon. Under "Lines" you can change the line color, thickness, and style, such as dashed or dotted.
Marker: You can add markers to the data points on a Line Chart to make them stand out. To do
this, select the Line Chart visual, go to the "Visualizations" pane, and click on the "Format" icon.
Under "Data Colors," you can select "Markers" and choose the marker shape and size.
Data Labels: You can add data labels to a Line Chart to show the actual value of each data point.
To do this, select the Line Chart visual, go to the "Visualizations" pane, and click on the "Format"
icon. Under "Data Labels," you can turn on the data labels and choose the font size, color, and
position.
Axis: You can customize the axis in a Line Chart by changing the axis title, font size, color, and
position. To do this, select the Line Chart visual, go to the "Visualizations" pane, and click on the
"Format" icon. Under "X-Axis" and "Y-Axis," you can change the axis title, font size, color, and
position.
Area Chart
• The area chart is similar to a line chart, but with the addition of shaded areas below or above
the line to create a filled-in area.
• A visual representation of data that displays the quantitative data as an area between the x-
axis and the plotted line.
Content
• Pie Chart
• Donut Chart
• When to use a Pie Chart
• How to add a Pie chart
• How to customize a Pie Chart
Pie Chart
In Power BI, a pie chart is a type of data visualization that represents data in a circular format. It
displays data as a circle divided into slices, each slice of the chart is proportional to the value it
represents in relation to the whole and the sum of all the slices is 100%.
In Power BI, you can create a pie chart by selecting the chart type, selecting the data fields to
include, and customizing the formatting and appearance of the chart as needed. You can also add
additional elements, such as labels or data points, to help communicate your insights.
Donut Chart
A donut chart in Power BI is a variant of a pie chart that displays data as sectors of a circle with a
hole in the center. It is similar to a pie chart but with a blank center, which can be used to show
additional information or leave it empty for a more aesthetically pleasing look.
In a donut chart, each data category is represented by a segment of the circle, with the size of the
segment proportional to the value of the data. The segments are usually color-coded or labeled for
easy identification. Donut charts are useful for displaying data with several categories, where each
category's value contributes to the whole.
Step 3: Drag and drop the required fields from the Fields pane to the "Values" and "Legend" fields
well in the Visualizations pane.
Note:
The process of adding donut chart is almost same as pie chart, only difference in step 2 Click on
the "Donut Chart" icon from the "Visualizations" pane
• In Donut chart, there is one more option that is spacing . you can use spacing to change the
inner radius of donut chart.
Detail labels: To add detail labels to your pie chart, click on the chart and go to the "Visualizations"
pane. In the "Detail labels" card, you can choose to turn on or off the labels, change their position
(inside, outside, prefer outside and prefer inside), or modify their font, color, and size. You can also
choose to show additional information, such as the data value, percentage and category name by
selecting the appropriate options.
Rotation: To rotate your pie chart, click on the chart and go to the "Visualizations" pane. In the
"Rotation" option you can rotate your pie chart.
By customizing the legend, slicer, detail labels, and rotation in your pie chart, you can make it more
informative, interactive, and visually appealing. You can experiment with different settings and
options to find the best way to present your data and communicate your insights to your audience.
Note:
All the customization option of donut chart is almost same as pie chart, you can use the all the
customize option of pie chart in donut chart such as Legend, Slices, Detail labels and Rotation.
Content
• Table Visual
• When to use a Table Visual
• How to add a Table Visual
• How to customize a Table Visual
Table Visual
• A table visual is a type of visualization in Power BI that displays data in a tabular format.
• It consists of a logical series of rows and columns that represent the data.
• The table visual is useful for displaying large amounts of data and for allowing users to filter
and sort the data to find specific information.
• It can display any type of data, including text, numbers, and dates.
• Drag and
drop data
• You can add multiple number of data column from your dataset in Table
• Style presets: Power BI provides built-in style presets that you can use to change the
appearance of the table. You can choose from various preset styles that include colors, fonts,
and other visual elements.
• Totals: If you want to display a total row at the end of the table, you can turn on the Totals
option in the Values section of the Fields pane. You can also choose which columns to show
totals for and customize the appearance of the total row.
• Cell Elements: You can format individual cells in the table by changing their background
color, font color, icons, and other visual elements. You can also use conditional formatting to
highlight cells based on their values. To format a cell, select it and use the Format pane to
make your changes.
Adding a Matrix | Cheat Sheet
Content
• Matrix visual
• When to use a Matrix visual
• Matrix vs Table
• How to add a Matrix visual
• How to customize a Matrix Visual
Matrix Visual
• A highly interactive visual that enables users to analyze data by summarizing and comparing
it across different categories or groups.
• Rows and columns of the matrix are populated by grouping data based on the values of one
or more fields.
• Data can be aggregated using functions such as sum, count, average, etc.
• Resulting values are displayed in the cells of the matrix.
Matrix vs Table
Point of
Table Visualization Matrix Visualization
Difference
Displays data in a Tabular format in Rows Summarizes data by aggregating values
Format
and Columns across rows and columns
Useful for displaying detailed data and Useful for summarizing data and
Purpose allowing users to interact with the data by displaying totals, subtotals, and details in
sorting, filtering, and grouping data a hierarchical format
Users can drill down into the data to see
Users can interact with the data by more details, and to expand or collapse
Interactivity
sorting, filtering, and grouping data rows or columns to focus on specific
areas
Shows total sales amounts by region and
Shows individual sales records with fields
by product, with the ability to expand or
Example such as date, product, region, and sales
collapse rows or columns to see more
amount
details
• Drag and drop the data fields from dataset into the Rows, Columns and Values field wells of
the matrix.
Note:
The formatting options available for the Table visual in Power BI can also be applied to the Matrix
visual.
• Style presets: Power BI provides built-in style presets that you can use to change the
appearance of the matrix.
• Row subtotals/Column subtotals: If you want to display a total of rows and columns at the
end of the matrix, you can turn on the these option.
• Cell Elements: You can format individual cells in the marix by changing their background
color, font color, icons, and other visual elements. You can also use conditional formatting to
highlight cells based on their values.
Content
• Slicer
• When to use a Slicer
• How to add a Slicer
• How to customize a Slicer
Slicer
• A Slicer is a type of visual element in Power BI that allows users to filter data in a report or
dashboard.
• It provides an interactive way to narrow down the data displayed in visualizations by
allowing users to select one or more values from a list of options.
• Slicers are useful for exploring data across different dimensions or scenarios, and for
providing a quick way to filter data.
• They work by creating a filter based on the selected values, which in turn updates the data
displayed in other visualizations in the report or dashboard.
Slicer Header: You can modify the slicer header such as title, font and color of header and header
border such as position, color and width of header board.
Values: You can modify the slicer value such as font, color, padding, background and border of the
values of the slicer.
Organizing your Dashboard | Cheat Sheet
Content
• Organizing your Dashboard
• Tips for designing a great Power BI dashboard
Quick Tip: Pie charts are best if they have fewer than five categories.
• White or light color showcases the elements present inside the tile.
• Dark colors dominate the elements.
Legend Spacing
• Space between the title, bars and text will enhance the information.
• Do not keep the Title in the corner of the tile adjust them with the settings.
Tile Arrangement
Content
• Combo Chart
• When to use a Combo Chart
Combo chart
• A combo chart in Power BI combines a line chart and a column chart into one visualization.
• A combo chart is helpful when you want to show multiple types of data in one chart, or
when you want to compare data that has different value ranges.
• This allows for a quicker comparison of the data.
Content
• How to add a Combo Chart
• How to customize a Combo Chart
• Add the X-axis data by dragging and dropping it into the "X-axis" field in the "Fields" pane.
• Add the column chart data by dragging and dropping it into the "Column y-axis" field.
• Add the line chart data by dragging and dropping it into the "Line y-axis" field
How to Customize
a Combo Chart
• To format the
line in your
combo chart,
go to "Format
your visual" >
"Visual" >
"Lines" Here,
you can change
the color and
thickness of
the line. You
can change the
shape type of
the line.
• To format the column in your combo chart, go to "Format your visual" > "Visual" >
"Column" Here, you can change the color and transparency of the column, and adjust the
spacing between columns.
• You can also Show Markers, can Change Shape type in "Markers".
Scatter Chart | Cheat Sheet
Content
• Scatter Chart
• When to use a Scatter Chart
Scatter Chart
• Scatter chart in Power BI is a type of visualization that displays data points as dots on a two-
dimensional chart.
• Scatter charts are used to show the relationship between two variables, such as how one
variable affects the other.
• In a scatter chart, one variable is plotted on the horizontal axis (x-axis), and the other
variable is plotted on the vertical axis (y-axis).
• Each data point represents a combination of the two variables and the position of the point
on the chart corresponds to the value of each variable.
• Scatter charts can be used to identify patterns or trends in the data, such as a positive or
negative correlation between the two variables.
When to use a Scatter Chart
• To show relationships between two numerical values.
• To plot two groups of numbers as one series of x and y coordinates.
• To use instead of a line chart when you want to change the scale of the horizontal axis.
• To display worksheet data that includes pairs or grouped sets of values.
• To show patterns in large sets of data, for example by showing linear or non-linear trends,
clusters, and outliers.
• To compare large numbers of data points without regard to time.
• The more data that you include in a scatter chart, the better the comparisons that you can
make.
Content
• How to add a Scatter Chart
• How to customize a Scatter Chart
Step 4: You can also drag and drop additional fields into the "Legend" or "Size" field wells to add
more dimensions to your scatter chart.
Marker: you can change the appearance of the data points or markers on the chart. Some of the
marker options that you can customize in Power BI include:
Marker shape: You can choose from a variety of marker shapes, such as circles, squares, diamonds,
triangles, and more.
Marker size: You can adjust the size of the markers using a slider or by typing in a specific value.
This allows you to make the markers larger or smaller, depending on your preference.
Marker color: This allows you to use different colors to represent different data points or to make
the chart more visually appealing.
Zoom Slider: The Zoom Slider is a customization option in a Scatter Chart in Power BI that allows
you to zoom in and out of the chart to focus on specific data points or areas.
This feature can be particularly useful when you have a large amount of data and want to focus on a
specific subset of that data.
Content
• Gauge Chart
• When to use a Gauge Chart
Gauge chart
• A Gauge Chart is a circular arc that shows a single value that measures progress toward a
goal or target.
• The line or needle on the chart represents the goal or target value, and the shading represents
the progress toward that goal.
• Gauge charts are useful for displaying metrics that are best understood in the context of a
range or a target value.
• For example, a gauge chart can be used to show progress towards a sales target, with the
pointer moving towards the target value as sales increase.
Content
• How to add a Gauge chart?
• How to customize a Gauge chart?
• Data Label: You can format the data label, target label, and call out value.
• Title: You can format the title in General option.
Waterfall Chart | Cheat Sheet
Content
• Waterfall Chart
• When to use a Waterfall Chart
Waterfall Chart
• A waterfall chart displays how an initial value(like net income) is affected by a series of
positive and negative values, resulting in a final value.
• It is often used to show how different factors contribute to a change in a specific metric,
such as sales revenue or expenses.
• A waterfall chart in Power BI consists of columns that represent the individual changes, with
the length of the column proportional to the magnitude of the change.
• The resulting chart provides a clear visual representation of the total change and how it is
composed of individual contributing factors.
Content
• How to add a Waterfall Chart
• How to customize a Waterfall Chart
• Drag and drop the fields you want to use into the correct fields:
• Month from Date hierarchy in Category field.
• Profit in Y-axis field.
How to customize a Waterfall Chart
Note: Waterfall charts have all the customization options just like the column charts such as X-axis,
Y-axis, legend, Data labels etc.
• You can change the color of the columns from the Columns option.
Map Visualization | Cheat Sheet
Content
• Map visualization
• When to use a Map
Map Visualization
• The map visual in Power BI is a type of visualization that allows you to display location-
based data on a map.
• With map visualization, users can display data in a way that is visually appealing and easy to
understand.
• Users can add their own data to the map by using latitude and longitude coordinates or by
using geographical data such as city names, postal codes, or country names.
• Map visualization can be used for various purposes such as sales analysis, demographic
analysis, and market research.
Note:
In Power BI, map visualization uses Bing Maps to display data.
Types of maps in Power BI
There are two types of default map visuals available in Power BI.
1. Basic Map
• It displays points on a map as circles or bubbles that vary in size based on a specific
value or data point.
2. Filled Map
• It shows how a value varies in proportion over geography or region by using shading,
coloring, or patterns.
Content
• Points to Remember
• How to add a Basic Map
Points to Remember
Quick Tip:
Whenever working with location fields (country, state, city, etc.), it's better to tell Power BI which
column is location-based. Therefore, we need to categorize columns as country, state, city, etc. for
location-based visualizations.
Warning: You may get error "Map and filled map visuals are disabled" while adding map visuals in
your report.
Content
• How to add a Filled Map
• How to add different shades in Filled Map
Content
• Q&A Visual
• When to use a Q&A Visual
• Core components of the Q&A Visual
Q&A Visual
• The Q&A visual in Power BI allows users to ask natural language questions and get answers
in the form of a visual.
• The Q&A visual is powered by a natural language engine that understands the meaning
behind the user's question and maps it to the appropriate data in the model.
Q&A tooling
By using the Q&A tooling in Power BI, you can enhance the natural language experience for your
users.
• Review questions your users have asked.
• Teach Q&A to understand questions.
• Manage terms you've taught Q&A.
• add Field synonyms to match the columns
Teach Q&A
• Teach Q&A allows you to teach Power BI's natural language processing engine new terms
related to your data.
• To begin, enter a question containing an unrecognized word or phrase.
• Q&A will prompt you to define it by entering a field name that corresponds to what the
word represents.
Field synonyms
• Alternative names can be used for field names when working with data.
• For example, Selling price can be referred to as sale , which can be added as a synonym for
the field
• In Field synonyms, select table to expand
• You can quickly see all the terms in one place and add or remove terms for multiple
columns.
Suggest questions
• It allows you add suggested questions for the visual, which will appear as suggestions to
users
• This can be useful if you want to include popular or commonly asked questions
Q&A tooling | Hands On guide
Content
• Q&A tooling
• Get started with Q&A tooling
Q&A tooling
By using the Q&A tooling in Power BI, you can enhance the natural language experience for your
users.
• Review questions your users have asked.
• Teach Q&A to understand questions.
• Manage terms you've taught Q&A.
• add Field synonyms to match the columns
Field synonyms
• Alternative names can be used for field names when working with data.
• For example, Selling price can be referred to as sale, which can be added as a synonym for
the field
• In Field synonyms, select table to expand
• You can quickly see all the terms in one place and add or remove terms for multiple
columns.
Suggest questions
• It allows you add suggested questions for the visual, which will appear as suggestions to
users
• This can be useful if you want to include popular or commonly asked questions
Funnel chart
• A Funnel Chart shows data through different stages in a process.
• Each stage is represented by a horizontal bar with the width of the bar proportional to the
percentage of items in that stage.
• The bars are arranged in decreasing order of width.
• They are ideal for visualizing the flow of data through a sequence of stages, where the
values decrease as they move from one stage to the next.
Content
• Treemap visual
• When to use a Treemap Visual
• Examples
Treemap Visual
• A Treemap visual in Power BI displays hierarchical data as nested rectangles.
• Each level of the hierarchy is represented by a colored rectangle (branch) containing smaller
rectangles (leaves).
• The size and color of each rectangle represents a different data value, allowing you to see
patterns and trends in your data
• The rectangles are arranged in size from top left (largest) to bottom right (smallest).
Content
• How to add a Treemap Visual
• How to customize a Treemap Visual
Content
• Ribbon Chart
• Ribbon Chart vs Stacked Column Chart
• When to use a Ribbon Chart
Ribbon Chart
• A Ribbon chart is used to show changes in data over time.
• Ribbon charts are effective at showing rank change, with the highest value always displayed
on top for each time period
• In a ribbon chart, the X-axis represents time, and the Y-axis represents the value of the data.
• The different categories of data are represented by colored ribbons that flow and overlap
with each other.
• The width of each ribbon represents the proportion of the data that belongs to that category.
Content
• How to add a Ribbon Chart
• How to Customize a Ribbon Chart
• 100% connector transparency makes ribbon chart look like stacked column chart
Multi-row Card | Cheat Sheet
Content
• Multi-row Card
• When to a use Multi-row card
Multi-row Card
• In Power BI, a multi-row card is a type of visualization that displays data in multiple rows.
• Where each row represents a unique value for a category.
• With a multi-row card in Power BI, you can quickly and easily compare data across multiple
fields
• For example, we can visualize Total Sales, Profit and Quantity sold all in a single card
Content
• How to add a Multi-row Card
• How to a customize Multi-row card
• Cards option allows you to change the background color of your card, apply a border to the
card, change the border color, and make other formatting adjustments.
Content
• Key Performance Indicator (KPI) Visual
• Key Elements of a KPIs
• When to use a KPI visual
Content
• How to add a KPI visual
• How to customize a KPI visual
Note: The KPI visual displays the value of the last data point, which in this case is for the month of
December. Additionally, the trend chart in the background is equivalent to an area chart that shows
the profit by month.eate
• Date option - It shows the date for which the value it is showing
Adding a Filter | Cheat Sheet
Content
• Introduction
• When to use Filter?
• Types of Filter
• Slicer vs filters
Introduction
• A filter is a tool that allows you to limit the data displayed in your dashboard based on
criteria or on any specific condition.
• Filters remove all data except the data you want to focus on.
• Filters can be used to customize the view of the data based on your preferences.
Slicer vs filters
Slicer Filter
A slicer is a visual control that allows you to It is a tool for developers to configure visuals or
interactively filter data in a report report before it is provided to consumers
Slicer is an on-canvas, dynamic feature Filter is a hidden, static feature
It can be applied on all the pages of the same
Slicers are restricted to a report page
report
Slicer Filter
A filter can be applied to a specific visual on the
A slicer is only applied to entire page
page, such as tables, charts or cards
Slicers can interact ,users can pick and choose Filters are not interactive, control by power bi
what they want displayed in the visuals developer
Content
• How to add a Filter?
• To add a filter on a visual
• Basic filtering
• Advanced filtering
• Top N filtering
Basic filtering
• This is the simplest type of filtering, where you can select a specific value
Advanced filtering
• It allows you to create more complex filters using multiple conditions
• For example we want to filter data based on city
• Add city data column in “Add data fields here ”
• Select Advanced filtering in Filter types
• Select starts with condition from dropdown list and Type A in box below
• Once you have applied the filter the visual will only display the data for cities that start with
"A"
Top N filtering
• This type of filtering allows you to show only the top N items in a visual, where N is a
specified number.
• For example, Top 5 cities by sales
• We have a column chart of Selling price by city, we only want top 5 performing(cities with
highest sum of profit) cities in visual
• Show items - Enter specific number
• By value - drag and drop data column
Content
• Introduction
• Visual Interaction
• Types of Interactions:
• How to Edit Interactions
Introduction
• Cross filtering is a feature in Power BI that allows users to filter data in one visual based on
selections made in another visual on the same page.
Visual Interaction
• Visual interaction is a feature in Power BI that allows users to interact with different visuals
on a page by clicking or selecting data points in one visual to impact other visuals on the
same page.
• When a user clicks on a data point or selects a filter in one visual, this can trigger a filter or
highlight effect on other visuals
Types of Interactions:
• Filter
• Filters data in one visual based on selections made in another visual on the same
page.
• Highlight
• Highlights data in one visual based on selections made in another visual on the same
page.
• None
• Disables any interactions between visuals on the same page.
Content
• Drill Through Filtering
• Adding Drill Through Filters
• It will take you to the destination page to view the filtered data.
Note - Enabling the Keep all filters option during drill-through ensures that any filters that have
been applied on the source page or visual will also be applied to the destination page.
Content
• Introduction
• Hierarchy
• Types of Hierarchy in Power BI:
Introduction
• Drill down filtering in Power BI is a feature that allows users to explore hierarchical data in
greater detail by navigating from a higher level of data to a more detailed level..
• This feature is helpful when analyzing large amounts of data and enables users to quickly
gain insights into trends and patterns by drilling down into specific data points.
For example, a user can start by viewing total sales by year and then drill down to see sales by
quarter, month, and day.
Note - To use the drill mode, the Power BI visual must have a hierarchy
Hierarchy
• A hierarchy is a way of organizing related data fields into a structured order.
• It is used to create a drill-down report that allows users to drill down or roll up to different
levels of detail in a report or visualization.
For Example a date hierarchy includes the fields Year Quarter Month Day
User-defined hierarchies:
• These hierarchies are created by the users based on their specific needs.
• Users can create a user-defined hierarchy by selecting the relevant fields and arranging them
in a hierarchical structure.
• For example, a user may create a Geography Hierarchy that includes fields like Continent,
Country, State, and City
Drill Down | Hands On Guide
Content
• How to create a Hierarchy
• How to create a Drill Down Report
• You can drill down to next level of hierarchy by using above options
Formatting Filters | Hands on Guide
Content
• Filter Pane
• Show or Hide the Filters Pane
• Hide the Filter Pane While Editing
• Lock or Hide a Filter
• Format the Filters pane
• How to Format the Filter Pane
Filter Pane
• The filter pane in Power BI is a panel that displays all the filters applied to a report.
• The filter pane allows users to view and adjust all the filters that are currently in use.
• The filter pane contains filter controls that allow users to select values based on their
preferences.
• To change the filter pane's appearance, expand the "Filters pane" option
• You can then set the text size, background color, icon, and left border to complement the
report page's design
• Customize the background color by choosing a color of your choice
Content
• Filter Cards
• Filter have two states in Power BI
• How to Format Filter Cards
Filter Cards
These are visual elements that show the filters applied to a report or visual.
Filter have two states in Power BI
Default
• It is the initial state of a filter when it is added to a visual or report, where all data is
displayed and the filter is not restricting any data
Applied
• It indicates that the filter is restricting the data displayed in a visual or report.
• Once a filter has been applied, it will show the selected values or ranges and filter out the
rest of the data accordingly.
• If you want to differentiate between the Applied and Default state of a filter, you can apply
different formatting such as background color, font, size, etc. to each state.
Date Based Filter | Hands on Guide
Content
• Date Filters
• Date Filters using Slicer
• Date Range Slicer
• Date Filtering using Filter Pane
Date Filters
• We can filter data based on a specific date or date range
• It allows us to view data for a particular time period by filtering out unnecessary data
• For example, You can use the relative date filter to show only the sales data that's happened
within the last 30 days (or month, calendar months, and so on)
• Define any range just by dragging the slicer button to filter data
Relative Date Slicer
Relative dates are used to express time in relation to a specific point in time, rather than a fixed,
absolute date. For example, you could create a relative date filter that shows data for the last 30
days.
• Select date slicer => Format your visual => Under Visual => Slicer settings
• From style option, select Relative date
• We have three setting options in relative date slicer
• For the first setting, we have the following choices:
• Last
• Next
• This
• In the second setting in the relative date slicer, it takes a number to define the relative date
range.
Content
• Power BI Service
• Power BI Desktop vs Power BI Service
• Power BI Service Interface
Power BI Service
• It is a cloud-based business analytics service platform provided by Microsoft.
• It allows users to publish their Power BI reports and dashboards to the cloud.
• It provides a centralized platform where users can store and access their data, reports, and
dashboards securely from anywhere using a web browser.
• Power BI Service offers additional capabilities such as integration with other Microsoft
services like Excel, SharePoint, and Teams.
Quick Tip: You can access the Power BI service by visiting the following
link: https://app.powerbi.com/
Note: You can sign up for Power BI service only with your school or organizational email.
Content
• Creating a Dataset
• Creating report from this dataset
• Publishing your report from Power BI Desktop to Power BI Service
• Creating A Dashboard From A Report
• Adding a tile
• Adding a image
Creating a Dataset
• Go to "My Workspace" in the Power BI interface.
• Click on "New" to access the dropdown menu options.
• From the dropdown menu, select "Dataset" as your choice.
• Pick data source Excel or CSV
• You will find your published dataset here. Select it to create a report.
• You will have the option to create a report.
• Auto-create report - Power BI automatically generates a basic report
• Create a blank report - Open report canvas just like Power BI Desktop
• If you're not already signed in to the Power BI service, enter an account, then click or tap
Sign in.
• Enter a password, then click or tap Sign in.
• Choose a destination for the report, Select “My workspace” then click on the select button.
• The Power BI service loads the report in My workspace along with the dataset associated
with it.
• You can find your open dashboards and reports in the Workspaces section
Adding a tile
• Open your dashboard.
• Click on the "Edit" button. Select the option "Add a tile"
• You can add images, web content, videos, and text boxes to your dashboard
Adding a image
Content
• Collaboration using Power BI Service
• Share Reports or Dashboards
• Adding a Report to PowerPoint
Collaboration using Power BI Service
• Collaboration in Power BI service refers to the ability for multiple users to work together on
a report or dashboard
• It allows users to share their work with others, co-author, and make use of communication
tools to discuss and collaborate on the content
• You can share your report via copy link, email, Teams, and PowerPoint.
Adding a Report to
PowerPoint
Content
• Live Dashboard
• PubNub Streaming
Live Dashboard
• It is also known as real-time streaming.
• A live dashboard provides real-time data insights and updates as new data is added to the
data source.
• This means that the information displayed on the dashboard is constantly updating and
providing users with the most current view of their data.
PubNub Streaming
• PubNub is a data stream network that enables developers to easily and securely build and
scale real-time applications.
• In streaming data, information continuously flows in real-time from various sources.
• PubNub real-time streaming APIs allow you to generate, process and deliver streaming data
to any number of subscribers.
Content
• Creating a Live Dashboard
This
window
will open,
click on
the
"Create"
button at
the bottom
You can see your live dataset on your workspace
• Now Create a dashboard
• Give your dashboard a name
• Click on Edit to add a tile
• Select Custom Streaming Data
Contents
• Olympic Games
• Transport and Shipping
• Space Analytics
• Sales and Purchases
• Retail Analysis
Olympic Games
• Olympic Games Dashboard link
• The "120 Years of Olympic Games" Power BI report provides a comprehensive overview of
the modern Olympic Games from Athens 1896 to Rio 2016.
• It showcases historical data on various aspects, including participating countries, medal
counts, sports events, and records.
Retail Analysis
• Retail Analysis Dashboard link
• The Retail Analysis built-in sample contains a dashboard, report, and dataset that analyzes
retail sales data of items sold across multiple stores and districts.
• The metrics compare this year's performance to last year's for sales, units, gross margin,
variance, and new-store analysis.
Importance of Data Cleaning | Cheat Sheet
Content
• What is Data Cleaning?
• When do we do Data Cleaning?
• Advantages of Data Cleaning
• Common Data Quality Issues
• Consequences of Dirty Data
• Clean Data vs Unclean Data
• Various steps for Data Cleaning
• Tools for Data Cleaning
• Real life scenarios of Data Cleaning
Consistent Data
• Data cleaning ensures consistency in data across different sources, making it easier to
analyze and compare data across various systems
Increased Efficiency
• Data cleaning automates data processes, reducing the time and resources required to manage
data, resulting in improved productivity and efficiency
3. Erroneous data:
• Sometimes, companies collect wrong or mistaken information about their customers, For
example,
1. Putting in the unrealistic Birth Dates if a customer says they were born in the year
1900, which is a really long time ago, OR
2. They may have a customer who is listed as living in Antarctica.
• These kinds of errors can cause problems for the company because they make it difficult to
understand their customers and provide them with the right products.
• To fix this problem, the company can use use outlier detection techniques to identify and
remove erroneous data points.This helps the company to have better information about their
customers, which helps them make better decisions and create better products for everyone.
Content
• Introduction to EXCEL
• Fundamentals of Excel
• Excel Interface
• Excel as a Data Cleaning Tool
• Trim Function
• Proper Function
• Upper Function
• Lower Function
• Concatenate/Concat Function
Introduction to EXCEL
• Google Sheets is a cloud-based spreadsheet application that is part of the Google Workspace
suite, offering a range of powerful features for data management and analysis
• Google Sheets is a cloud-based spreadsheet application that is part of the Google Workspace
suite, offering a range of powerful features for data management and analysis like Gmail,
drive, cloud, etc
Fundamentals of Excel
• Workbook
• A workbook is a collection of spreadsheets. You can create a new workbook, open an
existing one, or save your work as a workbook
• Worksheets
• A worksheet is a single spreadsheet within a workbook. You can add, rename, and
delete worksheets as needed
Cells
• A cell is the intersection of a row and a column. You can enter data, formulas, and
functions in a cell
• Cell reference
• It is a way to identify and locate a specific cell within a spreadsheet. It is used to
refer to the value or content of a particular cell or to perform calculations based on
the values in other cells
• Cell B7 refers to the cell in the second column and seventh row
Formulas and Functions
• Formulas and functions are used to perform calculations on the data in your
spreadsheet. Excel has a wide range of built-in formulas and functions that you can
use, or you can create your own
Excel Interface
1. Ribbon
• The Ribbon is the top menu bar in Excel and contains all of the commands and
features that you can use to work with your data.
2. Quick Access Toolbar
• The Quick Access Toolbar is a customizable toolbar that provides quick access to
commonly used commands.
3. Workbook Area
• The Workbook Area is the main area where you can work with your data. It contains
multiple worksheets that you can use to organize your data.
4. Columns and Rows
• Columns are the vertical lines in the Workbook Area, and rows are the horizontal
lines. The intersection of a column and row is a cell.
5. Formula Bar
• The Formula Bar displays the contents of the currently selected cell, including any
formulas or functions that have been entered.
6. Status Bar
• The Status Bar displays information about the current status of your workbook, such
as the average of a range of cells or the total number of cells in your selection
Trim Function
• Removes extra spaces before, after, and between words in a cell.
• Useful for cleaning up leading or trailing spaces that may cause issues during data analysis
or matching.
• Example: Suppose you have the text " Hello World " in cell A1. To remove the extra spaces,
you can use the TRIM function like this: =TRIM(A1)
• The result will be "Hello World" without the extra spaces
Proper Function
• Capitalizes the first letter of each word in a cell and changes the other letters to lowercase.
• Example: If you have the text "hello world" in cell A1 and want to capitalize the first letter
of each word, you can use the PROPER function like this: =PROPER(A1)
• The result will be "Hello World" with the proper capitalization.
Upper Function
• Converts all letters in a cell to uppercase.
• Example: Suppose you have the text "hello world" in cell A1 and want to convert it to
uppercase. You can use the UPPER function like this: =UPPER(A1)
• The result will be "HELLO WORLD" in all uppercase letters.
Lower Function
• Converts all letters in a cell to lowercase
• Example: If you have the text "Hello World" in cell A1 and want to convert it to lowercase,
you can use the LOWER function like this: =LOWER(A1)
• The result will be "hello world" in all lowercase letters.
Note: While applying above functions It is recommended to use the "Paste as Values" (Use
Ctrl+Shift+V) after applying the formula because the cells will still contain the original formula,
and any changes made to the original text formula will affect the copied cells as well.
By using "Paste as Values," you convert the result of the "PROPER" function into static values. This
means that the copied cells will no longer contain the formula but only the final text. It allows you
to freely modify or delete the original text without affecting the converted values
Concatenate/Concat Function
1. Concatenate
• Joins two or more strings of text into a single cell. It allows you to combine the contents of
different cells or add static text.
• Example: Cell A1 contains the text "Hello" and cell B1 contains the text "World". By
using the Concatenate function, you can combine these two cells into a single cell. In cell
C1, you would enter the formula "=CONCATENATE(A1, B1)" or "=A1&B1". The result
in cell C1 would be "HelloWorld".
2. Concat
• Similar to Concatenate, it joins two or more strings of text into a single cell. It is a more
recent alternative that can handle a variable number of arguments.
• Example: Cells A1, B1, and C1 containing the texts "Hello", "World", and "!",
respectively. You can use the Concat function to merge these cells together. In cell D1, you
would enter the formula "=CONCAT(A1, B1, C1)". The result in cell D1 would be
"HelloWorld!".
3. Ampersand Operator
• In addition to the Concatenate function, Excel also supports the ampersand (&) operator for
concatenation.
• Example: Cell A1 containing the text "Hello" and cell B1 containing the text "World"
. To concatenate these cells using the ampersand operator, you would enter the formula
"=A1&B1" in cell C1. The result in cell C1 would be "HelloWorld".
3. Go to Folders
4. Browse folder to find the desired file
5. Click on the desired file to open
Adding Formulas in Excel
1. Click on the cell where you want to enter the formula. For example, if you want to add a
formula in cell C1, click on that cell.
2. Start typing the formula by typing the equal sign (=) followed by the formula expression.
For example, to add the values in cells A1 and B1, you can type "=A1+B1".
3. Once you have entered the formula, press Enter on your keyboard, and Excel will calculate
the result and display it in the cell.
4. The formula will be applied to the selected cell, and you can copy and paste it to other cells
as needed. Excel will adjust the references accordingly based on the relative position of the
cells.
Note: A dialog box or function arguments window will appear, allowing you to specify the inputs or
cell references for the formula. Enter the necessary values or cell references in the appropriate fields
4. Once you have entered the required information, click "OK" or "Apply" to insert the formula in
the selected cell.
Proper Function
• To apply the PROPER function in Excel, follow these steps:
1. Select the cell or range of cells containing the text you want to convert to proper
case.
2. In the formula bar at the top, type "=PROPER(" (without the quotes) to start the
PROPER function.
3. Select the cell or range of cells that contain the text you want to convert.
4. Close the function with a closing parenthesis ")"
.
5. Press Enter to apply the PROPER function.
• The selected cells will be updated, and the text will be converted to proper case, with the
first letter of each word capitalized and the remaining letters in lowercase.
Upper Function
• To apply the UPPER function in Excel to a desired cell, follow these steps:
1. Select the cell where you want the uppercase version of the text to appear.
2. In the formula bar at the top, type "=UPPER(" (without the quotes) to start the
UPPER function.
3. Select the cell that contains the text you want to convert to uppercase.
4. Close the function with a closing parenthesis ")"
.
5. Press Enter to apply the UPPER function.
• The selected cell will be updated, and the text will be converted to uppercase.
Lower Function
• To apply the LOWER function in Excel, follow these steps:
1. Select the cell where you want the lowercase version of the text to appear.
2. In the formula bar at the top, type "=LOWER(" (without the quotes) to start the
LOWER function.
3. After typing the opening parenthesis "(" for the function, select the cell that contains
the text you want to convert to lowercase.
4. Close the function with a closing parenthesis ")"
.
5. Press Enter to apply the LOWER function.
Note: Alternatively you can directly enter the text within the functions instead of referencing a cell.
It can be useful when you want to quickly convert specified text to desired case without the need for
a cell reference
Concat function
• To apply the CONCAT function in Excel, follow these steps:
1. Select the cell where you want the concatenated text to appear.
2. In the formula bar at the top, type
"=CONCAT("
3. Select the first cell or range that contains the text you want to concatenate.
4. Enter a comma (,) to separate the first argument from the next one.
5. Select the second cell or range that contains the text you want to concatenate.
Note: You can repeat steps iv and v for additional cells or ranges if needed.
Close the function with a closing parenthesis ")".
1. Press Enter to apply the CONCAT function.
• The selected cell will be updated, and the text from the specific cells or ranges will be
concatenated into a single string.
COUNTIF function
• The COUNTIF function in Excel allows you to count the number of cells within a range that
meet a specific criterion
• It can be useful for filtering or summarizing data based on specific criteria.
• You can use COUNTIF to count cells based on various conditions.
• For instance, counting the number of cells that are equal to a specific value, greater than or
less than a certain value, contain certain text, or match a pattern using wildcards.
• Cells that contain errors or are blank are not included in the count.
Conditional formatting
• Conditional formatting allows you to format cells based on specific conditions or criteria
• It helps you visually highlight data patterns or outliers.
• You can set conditions and choose formatting options such as color, style, and data bar
• It can be applied to individual cells or ranges and updates dynamically with changes in data
• This can be useful for highlighting specific values, identifying trends, or visually organizing
data.
• You can also edit or remove the conditional formatting by selecting the cells and accessing
the "Conditional Formatting" menu again.
Conditional formatting
Steps to apply conditional formatting in Excel:
1. Select the range of cells you want to apply conditional formatting to.
2. Go to the "Home" tab in the Excel ribbon.
3. Click on the "Conditional Formatting" button.
4. From the drop-down menu, choose the desired formatting rule, such as "Highlight Cells
Rules" or "Top/Bottom Rules."
5. Select the specific rule you want to apply, such as "Greater Than," "Duplicate Values," or
"Data Bars."
6. In the dialog box that appears, enter the necessary criteria or values for the selected rule.
7. Customize the formatting options as per your preference.
8. Click "OK" to apply the conditional formatting to the selected cells.
Excel will automatically apply the formatting based on the specified rules and conditions.
Google Sheets
• It is a cloud-based spreadsheet application that is part of the Google Workspace suite.
• It provides a user-friendly interface and allows users to create, edit, and collaborate on
spreadsheets online.
• It offers powerful features for data cleaning and analysis, making it a valuable tool for
professionals, students, and anyone who needs to work with data.
• Users can manipulate and analyze their data using a variety of functions and formulas
available in Google Sheets.
Synchronous Communication
• Built-in chat and comments enable seamless communication within the spreadsheet for
effective collaboration.
Named Ranges
• A named range is a descriptive name given to a specific range of cells in a worksheet
• After creating a named range, you can reference it in formulas by using its name instead of
the cell references.
• For example, if you named a range "Sales_Total," you can use "=SUM(Sales_Total)"
instead of "=SUM(A1:B10)".
Column Stats
• Column Stats gives insights about the values within a column, so you can identify problems
• It provides insights into the distribution and characteristics of data within a specific column
• Column statistics can help identify data quality issues, such as missing values or
inconsistencies, by examining the count or sum of valid values
• You can view visualizations , frequency tables, and summary statistics at the column level
Conditional formatting
• Conditional formatting in google sheets is a feature that allows you to apply formatting rules
to cells based on specified conditions
• It is more commonly used to visually highlight or emphasize specific data patterns
• You can highlight cells, change font or background colors, apply data bars, color scales, or
icon sets using conditional formatting
• Conditional formatting improves data readability and allows you to make data-driven
decisions more efficiently
Single color
• Under "Format cells if," choose the condition that you want to trigger the rule.
Under "Formatting style, choose what the cell will look like when conditions are met.
Color scale
• Under "Preview," select the color scale. Then, choose a minimum and maximum
value, and an optional midpoint value. To choose the value category, click the Down
arrow .
4. Click Done
Importance of Data Transformation | Cheat
Sheet
Content
• What is Data Transformation?
• Importance of data transformation in data analysis
• Data Cleaning vs Data Transformation
• Key Transformation Steps
• Data Transformation Example
• Benefits of Data Transformation
• Tools for Data Transformation
Solution
• By applying extraction, parsing, and filtering techniques, the company can:
• Extract relevant details from the reviews, such as product names, ratings, and comments.
• Parse and structure the extracted data into a consistent format.
• Filter the data based on specific criteria, such as ratings or sentiment.
• Analyze trends and patterns to improve product development and customer satisfaction.
This allows the company to gain insights from customer feedback, identify areas for improvement,
and enhance the overall customer experience.
Scenario 2
• An e-commerce company needs to analyze product performance in different regions.
Solution
• By applying calculations and aggregations to their sales data, the company can:
• Transform the raw data into a structured format.
• Group the data by product categories and regions.
• Calculate metrics like total revenue and average sales quantity for each category in each
region.
• Generate visualizations to identify trends and make informed decisions.
This allows the company to understand the performance of product categories across different
regions, helping them optimize marketing, expand into new markets, and adjust inventory levels
accordingly.
Scalability
• Data transformation facilitates scalability by handling large volumes of data efficiently,
ensuring smooth operations as data grows.
Increased Efficiency
• Data transformation automates data preparation tasks, reducing manual effort and saving
time. It streamlines the data preparation process, allowing analysts to focus on analysis and
interpretation rather than spending excessive time on data cleaning and formatting. This
improves overall efficiency and productivity in data-related workflows
3. M Language
• Power Query in Power BI uses the M language for data transformation. M is a functional
language specifically designed for data mashup and transformation. It provides a flexible
and expressive syntax for manipulating and transforming data, allowing you to write custom
functions and scripts
Power Query
• Power Query is a data transformation and data preparation engine.
• It provides a user-friendly interface
• It has a wide range of built-in transformations and functions to automate and streamline the
data preparation process
• Power Query uses "M" functional language to define data transformation steps
• It also supports data cleaning and standardization by providing tools to handle missing
values, remove duplicates, and apply formatting rules.
User-Friendly Interface
• Power Query provides a user-friendly and intuitive interface, allowing users with varying
levels of technical expertise to perform data cleaning and transformation tasks. Its visual
interface and drag-and-drop functionality make it accessible to non-technical users as well
Wide Range of Transformations
• Power Query has numerous built-in tools for transforming and manipulating data, as well as
a customizable M formula language for more advanced operations
Applied Steps
• Power Query keeps track of all the transformation steps you apply in the Query Editor.
These steps are recorded as "Applied Steps" and can be viewed and modified later. This
feature allows for easy repeatability and reproducibility of data cleaning and transformation
processes
Extract
• Power Query provides a wide range of connectors to extract data from various sources such
as databases, files, web pages, APIs, and more.
• You can connect to the desired data source, provide necessary credentials, and specify the
data to be extracted
Transform
• Power Query offers a rich set of transformation capabilities to clean, shape, and manipulate
the extracted data.
• You can perform operations such as filtering, sorting, removing duplicates, splitting
columns, merging data, adding calculated columns, aggregating data, and applying custom
transformations using Power Query's intuitive interface.
Load
• After transforming the data, you can choose to load it into a destination of your choice, such
as a Power BI report or a data model.
• Power Query can load the transformed data directly into the data model of your Power BI
report, where it can be used for analysis and visualization.
• You can also create connections-only queries that allow you to reference the transformed
data without loading it into a destination.
It provides a user-friendly interface to access and utilize the available functionalities efficiently
• The ribbon navigation provides multiple tabs to add transforms, select options for your
query, and access different ribbon buttons to complete various tasks.
Home Tab
• The Home tab contains essential tools and commands for data manipulation. It includes
options for filtering, sorting, removing duplicates, changing data types, splitting columns,
and more. You can perform common data transformation tasks using the buttons and menus
in this tab.
Transform Tab
• The Transform tab offers advanced data shaping capabilities. It provides a wide range of
transformation options, such as merging queries, appending tables, pivoting data, unpivoting
columns, and applying conditional logic. This tab is useful for performing complex data
manipulations and restructuring.
View Tab
• The View tab offers various options to adjust the display and layout of the Power Query
interface. It allows you to toggle between different views, such as formula view and preview
view. There are a lot of other options like Monospaced, Column Quality, Column Profile,
etc.
Queries pane
• The query pane is placed on the left-hand side of the Query Editor.
• It lists all the queries in the current file.
• It allows you to manage, organize, and navigate through the queries, enabling you to view
and edit their properties, dependencies, and applied transformations.
• To manage any of the existing queries, right-click on its name This will give the following
options
Query Preview
• The query preview in power query editor shows a visual representation of transformed data
• It is located at the center of the power query editor window
• It is a valuable tool to evaluate and validate outcomes of transformations in Power Query
Editor
• It updates dynamically with each step
• It helps users validate transformations and assess data quality
• Users can verify desired changes have been applied correctly.
• It allows users to ensure accuracy before loading or further processing data
Query Settings
• On the right-hand side of the Query Editor, you can find the Query Settings pane which
contains the Properties and Applied Steps.
• This area displays the properties and settings of the currently selected query.
• It allows you to rename the query, modify the source, and manage applied steps.
Status Bar
• The Status Bar is a section at the bottom that provides important information and feedback
about the current state of the data and operations.
• It offers valuable insights to assist users in monitoring and managing their data
transformation process.
• The Status Bar displays statistics such as the number of rows and columns in the data, giving
users a sense of the data's size and complexity
Formula Bar
• The formula bar is a powerful and flexible tool for creating and editing transformation steps
using M language
• It enables users to customize and fine-tune their data transformations with precision
Merging columns
• Merging columns involves combining the contents of multiple columns into a single
column.
• It consolidates related information and creates a unified representation of data.
• By merging columns, scattered or split data can be brought together for easier analysis and
presentation
Splitting Columns
• Splitting columns means dividing one column to multiple columns
• It is the process of dividing a single column into multiple columns based on a delimiter or
pattern.
• It helps untangle combined information for analysis and organization.
• This technique extracts valuable insights, improves decision-making, and enhances data-
driven strategies
Merging Columns
Steps to Merge columns in Power Query
1. Select the columns to be merged:
• Hold the Ctrl key and click on the column headers of the columns you want to
merge.
• The sequence in which we select the columns will decide the order of the merged columns.
2. Right-click on one of the selected column headers and choose "Merge Columns" from the
context menu (or) Go to "transform" tab and in ribbon select "Merge Columns"
3. In the Merge Columns dialog box, specify the delimiter or separator that you want to use to
separate the merged values.
• You can choose from options like space, comma, or custom characters.
• You can also give the name to the column
4. Click "OK" to apply the merge operation.
Splitting Columns
Steps to split columns in Power Query
1. Select the column to be split by clicking on its header.
2. Click on the transform tab from Ribbon and Select Split column.
3. In the Split Column dialog box, choose the splitting option based on your desired criteria, such as
by delimiter, by number of characters, or by position.
4. Configure the specific settings for the chosen splitting option, such as selecting the delimiter
character or specifying the number of characters.
5. Choose whether to split the column into new columns or replace the original column with the
split result.
6. Click "OK" to apply the split operation. The selected column will be split based on the specified
criteria, creating new columns or replacing the original column with the split results.
Add Prefix and Suffix
Steps to add a prefix in Power Query:
1. Select the column you want to add the prefix to.
2. Go to the "Transform" tab and click "Add Prefix" in the "Text Column" group.
3. Enter the desired prefix in the dialog box.
4. Click "OK" to apply the prefix operation.
Steps to add a suffix in Power Query:
1. Select the column you want to add the suffix to.
2. Go to the "Transform" tab and click "Add Suffix" in the "Text Column" group.
3. Enter the desired suffix in the dialog box.
4. Click "OK" to apply the suffix operation.
Replace Value
Steps to replace values in Power Query
1. Select the column or range of cells where you want to replace values.
2. Right-click on the selected cells and choose "Replace Values" from the context menu.
3. In the Replace Values dialog box, enter the value you want to replace in the "Value To Find"
field.
4. In the "Replace With" field, enter the new value or error that you want to substitute.
5. Click "OK" to apply the replacement operation. The selected values will be replaced with the
new specified value.
Replace Errors
Steps to replace errors in Power Query
1. Select the column or range of cells where you want to replace errors.
2. Right-click on the selected cells and choose "Replace error" from the context menu.
3. In the Replace Errors dialog box, enter the value you want to replace with
4. Click "OK" to apply the replacement operation
5. The selected errors will be replaced with the new specified errors.
Fill Values
Steps to Fill Values in Power Query
1. Select the cell or range of cells where you want to apply the fill operation
2. Right-click on the selected cells and choose the "Fill" option from the context menu
3. In the Fill submenu, choose the specific fill option you want to apply:
• "Down" fills the selected cells with the values from the cell above
• "Up" fills the selected cells with the values from the cell below
4. Select the desired fill option, and the selected cells will be filled accordingly.
5. By following these steps, you can quickly apply the fill option in Power Query to populate
cells with values, create a series, or copy values from neighboring cells based on your
specific requirements
Data Types
• Data types are classifications that define the nature of data
• Data types determine the operations that can be performed on them
• Understanding data types is essential for data analysis
• Examples include numbers, text, dates, and Boolean values
• Data types are an essential aspect of Power Query as they enable data to be sorted, filtered,
and analyzed appropriately
• When data is loaded into Power Query, the application tries to determine the data type of
each column based on the data contained in it.
The different data types that can be encountered in Power Query include:
1. Text
• This data type is used to represent character strings such as names, addresses, and
other textual data. Text data is enclosed in double quotes.
2. Whole Number
• This data type is used to represent integer numbers such as age, years of experience,
and number of employees. Whole numbers do not have decimal points.
3. Decimal Number
• This data type is used to represent numbers that have a decimal point, such as
currency values, percentages, and ratios.
4. Fixed decimal number
• This data type is used to represent numbers with a fixed number of decimal places; it
has a specific, predetermined number of decimal places.
5. Date/Time
• This data type is used to represent dates and times. Power Query recognizes a wide
range of date and time formats.
6. Boolean
• This data type is used to represent binary values, that is, values that can only take on
two possible states: True or False.
7. Duration
• This data type is used to represent time intervals, such as the length of a movie, the
duration of a phone call, or the duration of a task.
8. Any
• The Any data type is the status given to a column that doesn't have an explicit data
type definition. Any is the data type that classifies all values. We recommend that
you always explicitly define the column data types for your queries from
unstructured sources, and avoid having any columns with the Any data type as the
output of your query.
Content
• Filters in Power Query
• Importance of filtering
• Auto Filters
• Types of filters
• Filters in Multiple Columns
Importance of filtering
Filtering in Power Query offers several benefits for data cleaning and preparation
1. Data Validation
• Filter out rows with missing or invalid values for data integrity
2. Handling Outliers
• Filter and investigate outliers or extreme values
3. Data Segmentation
• Segment data based on criteria for focused analysis
4. Streamlined Cleaning
• Apply filters to iteratively refine data quality
Auto Filters
• The list in the sort and filter menu is called the auto filter list, which shows the unique
values in your column.
Note: Sort and filter menu is the menu that appears on clicking the dropdown icon present in
column headers.
• You can manually select or deselect which values to include in the list.
• Any selected values will be taken into consideration by the filter; any values that aren't
selected will be ignored.
Types of filters
1. Text Filters
• These filters allow you to apply conditions on text values. You can use operators like
"equals," "contains," "starts with," or "ends with" to filter data based on specific text
patterns.
2. Number Filters
• Number filters enable you to apply conditions on numeric values. You can use operators
such as "equals," "greater than," "less than," "between," or "top N" to filter data based on
numeric ranges or specific values.
3. Date Filters
• With date filters, you can apply conditions on date or time values. You can filter data based
on specific dates, date ranges, or relative dates such as "today," "yesterday," or "last month."
• Each type-specific filters further provide 2 options to apply filtering
1. Basic
• With basic mode, you can implement up to two filter rules based on type-
specific filters
2. Advanced
• With advanced mode, you can implement as many type-specific filters as necessary from all
the columns in the table
Filters in Multiple Columns
• You can add filters to multiple columns just as you would add filters to a single column
• It refines your data based on specific criteria across different fields
• First apply filter to one column dataset will be filtered on the basis of first condition
• Then apply filter on another column in the filtered database to achieve desired result
Content
• Auto Filters
• Clear/Remove Filters
• Text Filters
• Number Filters
• Date Filters
Auto Filters
Steps to apply auto filters :-
1. Select the desired column
2. Click on small filter icon
• The list in the sort and filter menu is called the auto filter list
3. Specify the filter criteria by choosing the values you want to keep
4. Click "OK" - Result with selected values rows will be filtered
Clear/Remove Filters
• To remove column filters,
• Select the down arrow next to the column
• From the sort and filter Menu Choose "Clear filter."
Text Filters
• A new dialog box will appear containing "Basic" and "Advanced" filtering options
• Basic
• Advanced
3. Choose the desired option and fill the values accordingly
4. Click ok to apply the filter
Number Filters
Steps to apply Number filters :-
1. Select the column with Number Data type(Ex. Whole Number, Decimal Number)
2. Click on dropdown arrow of that column
3. Select "Number filters"
4. Select the desired operation (Ex. Equals, Greater than, Between)
A new dialog box will appear containing "Basic" and "Advanced" filtering options
5. Choose "Basic" option or "Advanced" based on your requirement
Date Filters
Content
• Use First Row as Header
• Use Headers as First Row
• Renaming a Column
• Keep Rows
• Remove Rows
Renaming a Column
• We can rename a column header based on values in the column to understand the dataset
easily.
• We can change the header name of each column just by double clicking on the header and
renaming it.
Keep Rows
• The "Keep Rows" feature allows to filter and retain specific rows from the whole dataset
• This helps in analyzing and visualizing the relevant data within your Power BI reports and
dashboards
• In Keep Rows, We have following options:-
• Keep Top Rows
• Keep Bottom Rows
• Keep Range of Rows
• Keep Duplicates
• Keep Errors
Keep Errors
• Keep errors preserves rows containing error values, enabling further analysis or
troubleshooting of problematic data
Remove Rows
• The "Remove Rows" feature allows to filter and remove specific rows from the whole
dataset
• It has features similar to the “Keep Rows” options but in “Remove Rows” we choose the
Rows to Remove
• In Remove Rows, We have following options :-
• Remove Top Rows
• Remove Bottom Rows
• Remove Alternate Rows
• Remove Duplicates
• Remove Blanks
• Remove Errors
• We can define a pattern by first choosing the starting row to be removed, then selecting the
number of consecutive rows to be removed in each iteration and finally the consecutive rows
to be kept in each iteration.
Remove Duplicates
• Remove duplicates allows you to remove all instances of duplicate values in a column.
Remove Blanks
• Remove Blanks eliminates rows with blank values
Remove Errors
• Remove errors Remove rows containing error values
Content
• Steps to Use First Row as Header
• Steps to Use Headers as First Row
• Steps to Rename a Column
• Steps to Keep Rows
• Steps to Remove Rows
2. Enter the number of rows you want to keep in the number of rows box
3. Click OK
2. Enter the first row you want to keep in first row box and Number of rows you want to keep
starting from the first row you want to keep in Number of rows box
3. Click OK.
2. Enter the number of rows you want to Remove from the bottom in the number of rows box
3. Click OK.
Statistics Option
• Statistics tool performs calculations or aggregations on existing data columns in your dataset
• These calculations can be performed in Power BI using the Statistics option feature
available in “transform” tab and “add column” tab
• To perform calculation on single existing column , you have to select “statistics” from
“Number Column” present in “transform tab”
• For calculation on two or more column you can use statistics option from “From Number”
present in “add column” tab
Standard Option
• Creates a new column based on a standard calculation or formula
• A standard option in Power Query enhances data tables by adding new calculated values
based on existing data columns
• In Standard option we can select random values to perform operations
• For example
• we can add,subtract,multiply any number (For ex. - 5) to any column
Exploring Data | Hands on guide
Content
• Steps to Group By
• Statistics Option
• Standard Option
Steps to Group By
1. Select the column
2. Go to group by option
• “Home tab” -> “Group by” OR
• “Transform tab” -> “Group by” OR
• Right click on the selected column -> “Group by”
Statistics Option
Content
• Choose Columns
• Go to Columns
• Remove Column
• Remove Other Column
• Reorder Columns
Choose Columns
• Choose columns options helps in choosing relevant columns
• It reduces the amount of data to process
• Hence minimizing memory usage and processing time
Go to Columns
• The "Go to column" feature in Power Query allows you to quickly navigate to a specific
column within your dataset
Remove Column
• This option allows you to select and remove specific columns from your dataset.
• The selected columns will be removed, and the remaining columns will be retained.
Reorder Columns
• This option modifies the order of columns within a table by rearranging their positions
• There are multiple ways to reorder columns in the power query editor
• Using "Move" option
• Dragging and dropping the column
Content
• Steps to Choose Columns
• Go to Columns
• Remove Column
• Remove Other Column
• Reorder Columns
Remove Column
1. Select the column to remove.
2. Go to the "Home" tab.
3. Click on "Remove Columns" in the "Manage Columns" group.
4. Choose "Remove Columns" to confirm the removal
Reorder Columns
1. Select the columns to reorder.
2. Go to the "Home" tab.
3. Click on "Move" in the "Transform" group.
4. Choose "Move Left" or "Move Right" to adjust the column order - We can also choose
“Move to beginning” or “Move to end” option
5. Repeat steps 3-5 if needed.
• Alternatively,
1. Select and drag the columns to the derired location
2. Release the cursor to drop at that position
Content
• Add Column
• Column From Example
• Index Column
• Conditional Column
• Duplicate Column
Add Column
• The "Add Column" tab allows to create new columns based on various transformations,
calculations, and data manipulations
• It provides a wide range of functions and options to customize column creation, enabling
users to enrich their data with derived values, conditional logic, etc.
• The "Add Column" option in Power Query ribbon offers several powerful features,
including:
• Column From Examples
• Conditional Column
• Index Column
• Duplicate Column
Index Column
• The Index column command adds a new column to the table with explicit position values,
and is usually created to support other transformation patterns
Conditional Column
• Conditional column in Power Query is a column that you add to a table based on a condition
• You can use the graphical interface to implement any logic you want
Duplicate Column
• The "Duplicate Column" option in Power Query allows you to create a copy of an existing
column in your dataset.
• This can be useful when you want to perform different transformations or calculations on the
duplicated column without affecting the original column.
• It helps in maintaining data integrity and provides flexibility in data manipulation within
Power Query.
Content
• Steps to Add Column From Example
• Steps to Add Index Column
• Steps to add Conditional Column
Steps to Add Column From Example
1. Select the column on which you want to apply changes
2. Add Column from Examples using From Selection option
4. Power Query will add a new column with sequential index values
Pivoting
• Pivoting involves re-arranging data from rows to columns
• It allows us to group and categorize data based on specific criteria
• Pivoting is often used with tools like pivot tables in spreadsheet software
• It helps uncover patterns, trends, and relationships in data
• By pivoting data, we can condense and present it in a more organized way
Unpivoting
• Unpivoting is the opposite of pivoting
• It turns columns into rows
• Unpivoting helps in expanding summarized data to its original detailed form
Transpose
• Transpose is a basic operation that rearranges data without aggregation
• It swaps the positions of rows and columns
• Transpose is useful for reorganizing data to fit a specific layout or for comparison purposes
Content
• Steps to Pivot Columns
• Steps to Add Index Column
• Steps to Transpose Table
4. In the "Pivot Column"dialog box, specify the values you want to use as pivot values.
• Select the aggregation function you want to apply to the pivoted column values (e.g.,
sum, count, average).
• Optionally, you can select additional options such as
"Don't Aggregate"
or
"Advanced options"
if needed
• This allows you to further customize the pivot transformation based on your specific
requirements
5. Click ok to perform Pivoting.
4. Power Query will add a new column with sequential index values
Content
• Steps to create a Custom Function
3. You can also add a column by selecting it in the list. Alternatively, you can write your own
formula by using the Power Query M formula language in Custom column formula.
2. The Custom column dialog box appears with the custom column formula you created.
3. Make changes according to the requirement and Click OK to apply.
Content
• Introduction
• Column quality
• Column distribution
• Column Profile
Introduction
• Column profiling is the process of analyzing and understanding the characteristics of
individual columns in a dataset.
• It involves analyzing the content and structure of a dataset to identify inconsistencies, errors,
and anomalies
• Power BI, has built-in data profiling tools that allow users to analyze and visualize data
quality.
• These tools provide new and intuitive ways to clean, transform, and understand data in
Power Query Editor. They include:
1. Column quality
2. Column distribution
3. Column profile
Column quality
• The Column quality checks the quality of the data in terms of valid, Error & Empty, also it
displays the percentage of data values associated with the selected table.
• The column quality feature labels values in rows in following categories:
1. Valid, shown in green.
2. Error, shown in red
3. Empty, shown in dark grey
• These indicators are displayed directly underneath the name of the column as part of a small
bar chart, as shown in the following image.
Column distribution
• This feature provides a set of visuals underneath the names of the columns that showcase the
frequency and distribution of the values in each of the columns
• Here you can see the distinct and unique records of the values in each of the columns as in
histogram visual.
• The data in these visualizations is sorted in descending order from the value with the highest
frequency.
• By hovering over the distribution data in any of the columns, you get information about the
overall data in the column (with distinct count and unique values). You can also select the
ellipsis button and choose from a menu of available operations
Column Profile
• This feature provides a more in-depth look at the data in a column. Column profile contains
a column statistics chart, the distribution of values in the column, like the count of errors and
empty values. Information such as the minimum, and the maximum values, count of unique
values, and the distribution of values in detail.
Column Statistics
• It displays Count, Error, Empty, Distinct, Unique, Empty String, Min, & Max of the selected
column.
Value Distribution
• As per value shows data in a bar graph.
• In the column profile above, you can see the distribution of values in the City column, you
can see more customers in Hyderabad and fewer in Delhi. You can also see the count of
rows, errors, and empty values.
• In the Age column, we can see the min and max value in the column, the count of distinct
and unique values, and much other information.
• Knowing the information above is very helpful for a data engineer. Because you can apply
the right transformation and target the right data values based on it.
Filter by value
• You can interact with the value distribution chart on the right side and select any of the bars
by hovering over the parts of the chart.
• The image below shows a column of product names that have been grouped by text length.
After the values have been grouped in the chart, you can interact with individual values in
the chart as described in Filter by value.
Content
• Steps to enable Date profiling tools
• Steps to open the Ellipsis button options
• Column Profile
3. Select the ellipsis button and choose from a menu of available operations
Column Profile
Content
• Query Pane
• Usage of Query Pane
• Context Menu
• Various options available in Context Menu
Query Pane
• In Power BI, the query pane refers to a specific area within the Power Query Editor where
you can view and manipulate data transformation steps applied to your data source
• The query pane displays a list of applied steps, which can be rearranged, edited, or removed
as needed.
Navigation
• The most basic usage of the queries pane is to navigate to all of the queries
• The navigation is similar to a file explorer
• To switch between the queries, just select the query you want to go to
Creating Query
• The Queries Pane in Power BI allows for creating different queries.
• You can start by duplicating an existing query.
• Duplicating a query provides a foundation for making modifications.
• It is useful when applying similar transformations to different data subsets.
Context Menu
• Similar to features throughout the ribbon and the editor, the context menu of a query lets you
make transformations directly onto the query
• The context menu in the query pane provides additional options and actions for working
with queries.
• It can be accessed by right-clicking on a query within the queries pane.
• The context menu offers various functionalities to manage and modify queries.
• It includes options such as editing query settings, renaming queries, duplicating queries, and
deleting queries.
Delete
• Deleting a query in Power Query involves removing an existing query from the query pane
and the associated data model
Rename
• Renaming a query in Power Query involves assigning a new name to an existing query to
provide it with a more descriptive or meaningful label
Duplicate
• Duplicating a query will create a copy of the query you're selecting. Duplicating allows you
to preserve the original data while performing additional transformations in duplicated
version.
Reference
• Referencing a query creates a new query that utilizes the transformations applied in a
previous query.It does not duplicate the original query or its steps.Changes made to the
referenced query automatically propagate to the new query. The referenced query serves as a
foundation for the new query.
Move Up
• Moving a query up in Power Query refers to changing its position within the list of queries
in the query pane so that it appears higher in the order.
• By moving a query up, you can prioritize its execution, ensuring that it is processed before
queries that appear below it.
Move Down
• By moving a query down, you can prioritize its execution to occur after queries that appear
above it
• These actions allow you to adjust the sequence of queries and control the order in which
they are executed during data transformation
Content
• Steps for Creating New Query in Query Pane
• Various options available in context menu
Delete
• Deleting a query in Power Query involves removing an existing query from the query pane
and the associated data model
4. There will be an additional pop-up confirming the deletion, select "delete" to delete the query
Rename
• Renaming a query in Power Query involves assigning a new name to an existing query to
provide it with a more descriptive or meaningful label
3. Choose “Duplicate”.
Reference
• Referencing a query creates a new query that utilizes the transformations applied in a
previous query.It does not duplicate the original query or its steps.Changes made to the
referenced query automatically propagate to the new query. The referenced query serves as a
foundation for the new query.
Copy/Paste
Steps to copy and paste a query in Power Query :-
1. Select the query to be copied.
2. Right-click and choose "Copy".
3. Right-click in the query pane and choose "Paste". Optionally, rename the pasted query.
Move to group
Steps to Move to group in the query pane :-
1. Select the queries.
2. Right-click and choose "Move To Group".
3. Select the desired group
Combining Queries
• Combining Queries is the process of merging or joining multiple tables or queries together
to create a single unified dataset
• Ways to combine queries
• Appending Queries
• Merging Queries
Append Queries
• In Power Query, the "Append" operation allows you to combine multiple tables or queries
together vertically, stacking the rows from each table or query to create a single consolidated
table.
• The append operation creates a single table by adding the contents of one or more tables
• The resulting table will have the combined rows from all the appended tables or query
• When you append tables or queries, the columns must have the same names and data types
for the operation to succeed
• If one of the appended tables doesn't have a values in the cell from other tables, the resulting
table shows null
Merge Queries
• A merge queries operation joins two existing tables together based on matching values from
one or multiple columns
• You can choose to use different types of joins, depending on the output you want
• In the event that one table doesn't have columns found in another table, null values will
appear in the corresponding column, as shown in the Referer column of the final query
Append Queries
Steps to follow for Appending the queries
1. From the left pane of Power Query Editor, select the query to merge.
2. Click on the Home Tab in the Ribbon Menu.
• Append queries displays the Append dialog box to add additional tables to the current query.
• Append queries as new displays the Append dialog box to create a new query by
appending multiple tables
5. The following Append dialog box will appear. Choose option depending on the number of tables
to be appended
• This has two modes:
1. Two tables : Combine two table queries together. This mode is the default mode.
2. Three or more tables : Allow an arbitrary number of table queries to be combined.
6. In the Available table(s) list, select each table you want to append, and then select Add.
7. After all the tables you want appear in the Tables to append list, select OK.
Merge Queries
• Here we are merging following two tables based on Common column - Product ID
1. Table 1 – Product
2. Table 2 – Availability
2. This will open the Expand dialog box to allow you to choose which columns to expand
Content
• Applied Steps
• Accessing the Applied Steps list
• Using Applied Steps List
Applied Steps
• Applied steps in Power Query track the sequence of transformations applied to a dataset
• Each step represents a specific action or manipulation performed on the data
• Applied steps provide a structured way to track, modify, and reproduce the data
transformation process
• Any transformations you done on your data will show in the Applied Steps list
• For instance, if you change the first column name, it will display in the Applied Steps list as
Renamed Columns
Content
• Steps for Accessing Applied Steps
• Steps to open Applied Steps context menu
Rename step
1. To rename a step, right-click the step
2. Select Rename.
3. Enter in the name you want,
4. Then either select Enter or click away from the step.
Delete step
1. To delete a step, right-click the step and select Delete.
2. Alternatively, select the "x" next to the step.
Move step
Move Up
• To move a step up one position in the list, right-click the step and select Move up
Move down
• To move a step down one position in the list, right-click the step and select Move Down
Alternatively,
• Drag and drop the step to the desired location.
Properties
• Helps in editing "Step names" and their "descriptions"
1. To edit the step, right-click the step
2. Select Properties. A pop-up window will open
3. In the window, you can change the step name and description and save the changes by
selecting OK.
Introduction to Data Modeling | Cheat Sheet
Contents
• Data Modeling
• Importance of Data Modeling
• Types of Data Modeling
• Data Modeling Techniques
Data Modeling
• Data model is a collection of data tables and their relationships with each other
• It is used to organize, analyze and present data in a meaningful way
• The data model in Power BI provides the foundation for creating reports and visualizations
Relational Modeling
• It is a traditional approach to data modeling.
• This type of data modeling involves designing a data model based on a set of related tables
with defined relationships between them
• In this model, data is represented in the form of two-dimensional tables consisting of
columns and rows known as attributes and tuples
Dimensional Modeling
• Dimensional modeling in Power BI is a data modeling technique that focuses on organizing
and structuring data in a way that supports efficient analysis and reporting.
• It involves creating dimension tables and fact tables, which are the two primary types of
tables used in dimensional modeling.
Facts Tables
• Fact tables store the numerical or measurable data that are being analyzed, such as
sales figures, quantities, or revenue
.
• Fact tables contain the quantitative or additive values associated with the dimensions.
• Each row in a fact table represents a specific measurement or event and includes foreign
keys that link to dimension tables.
• Fact tables can have multiple measures (numeric values) that provide insights into the
business performance.
Dimensional Tables
• Dimension tables represent descriptive attributes or categories by which data is analyzed.
• Each dimension table contains the unique values or combinations of attribute values for a
specific dimension.
• Examples of dimensions include "Product," "Time," "Location," or "Customer."
• Dimension tables typically have one row for each unique dimension value, and each row
contains the attributes associated with that dimension value.
• Dimension tables are often connected to fact tables through relationships.
Data Modeling Techniques
• Data modeling techniques are used to structure and organize data for effective analysis and
reporting.
• These techniques help optimize data storage, enhance query performance, and provide a
user-friendly environment for data exploration.
Star Schema
• It is a widely adopted data modeling approach used in Power BI for optimized performance
and usability
• It consists of a central fact table surrounded by dimension tables
• In a star schema, each dimension table is directly connected to the fact table through
relationships.
Snowflake Schema
• It is a type of modeling technique where dimension tables are further normalized into
multiple related tables
• This data model contains chains of dimension tables
• Snowflake schema is an extension of the star schema, aiming for more normalization of the
dimension tables.
• This normalization reduces data redundancy by separating repetitive attributes into separate
tables.
• The snowflake schema resembles a snowflake-like shape, with dimension tables branching
out into more tables.
Techniques of Data Modeling part 1 | Cheat
Sheet
Content
• Relationship
• Need of relationship
• Types or Cardinality
Relationship
• In Power BI, a relationship refers to the connection established between two tables based on
one or more common columns.
• It defines how the data in one table relates to the data in another table, allowing for data
analysis and visualization across multiple tables.
• Relationships are fundamental aspects of data modeling in Power BI, enabling users to
create meaningful and interconnected views of their data.
• By defining relationships, you can combine data from different tables, perform cross-table
filtering, and enable efficient data exploration and aggregation in Power BI reports and
visualizations.
Need of relationship
Data Integration
• Relationships allow you to integrate data from different tables into a single data model
• For example : you can create a relationship between the Sales table and the Customers table
based on the common field CustomerID
Cross-Table Filtering
• Relationships enable cross-table filtering, meaning that filters applied to one table can
propagate to related tables.
• For example : A table containing sales information and another table with customer details.
If you define a relationship between the two tables based on the Customer ID field, selecting
a specific customer in a visualization will automatically filter the sales data to show only the
sales made by that customer
Data Exploration
• With relationships established, you can create interactive reports and dashboards where
users can navigate through related data.
• For example : You can create a report that shows sales by category and allows users to drill
down to see specific products.
Data Aggregation
• By defining relationships, you can create measures and calculations that aggregate data
correctly across related tables
• For example : You can calculate total sales, average price, or cumulative sales based on the
established relationships
Types or Cardinality
One-to-One(1:1)
• A one-to-one relationship means that in one table, a specific value occurs only once, and in
the related table, the same value also occurs only once
• For example: In a dataset representing employees and their personal information, each
employee can have only one corresponding record in the personal information table, and
each record in the personal information table is related to a specific employee.
One-to-Many(1:*)
• In a one-to-many relationship, a column in one table contains a unique value, while the
related table can have multiple instances of that value
• For example: In a dataset representing a customer and their orders, a single customer can
have multiple orders, but each order is associated with only one customer.
Many-to-Many(*:*)
• In a many-to-many relationship, multiple instances of one entity can be associated with
multiple instances of another entity
• For example: In a dataset representing students and subjects, each student can enroll in
multiple subject, and each subject can have multiple students.
Manage Relationships
The "Manage Relationships" feature allows you to define, edit, and manage the relationships
between tables in your data model To access the Manage Relationships feature in Power BI, you can
follow these steps:
1. Open Model view in power BI
2. Navigate to the "Home" tab on the ribbon at the top.
3. Click on the "Manage Relationships" button in the "Relationships" section.
Dialogue Box
The Manage Relationships dialog box in Power BI is the user interface where you can define, edit,
and manage relationships between tables in your data model
Autodetect
• In “Manage relationships” window, click on “Autodetect”
• power BI Desktop analyzes the column names in the data to identify potential relationships
• It looks for similarities and matches in column names to determine if there is a potential
relationship between tables
Creating Relationships
• allows you to define a new relationship between tables in your data model. It enables you to
establish a connection between two tables based on a common field or column
To create a new relationship, you can follow these steps:
1. Click on the "Manage Relationships" button in the "Modeling" section.
2. In the Manage Relationships dialog box, click on the "New" or button.
3. Select the primary key field from one table and the corresponding foreign key field from the
other table to establish the relationship.
4. Specify the desired cardinality for the relationship and cross filter direction.
5. click on make this relationship active and click on Ok button.
Edit Relationships
• The "Edit" feature in the Manage Relationships allows you to modify and adjust the
properties of an existing relationship between tables in your data model.
• It enables you to make changes to the fields used, cardinality, cross-filtering behavior, and
the active/inactive state of the relationship.
Here are the steps to edit a relationship using the Manage Relationships:
1. Click on the "Manage Relationships" button in the "Modeling" section.
2. In the Manage Relationships dialog box, locate the relationship you want to edit.
3. Select the relationship by clicking on it.
4. Click on the "Edit" button.
5. Modify the properties of the relationship as needed.
Delete Relationships
• The "Delete" Relationships feature in the Manage Relationships dialog box in Power BI
allows you to remove relationships that are no longer needed in your data model.
• Deleting a relationship breaks the connection between tables, and any calculations or
filtering based on that relationship will no longer work as expected.
To delete a relationship using the Manage Relationships, you can follow these steps:
1. Click on the "Manage Relationships" button in the "Modeling" section.
2. In the Manage Relationships dialog box, locate the relationship you want to delete.
3. Select the relationship by clicking on it
4. Click on the "Delete" button.
Active Relationship
• When a relationship is marked as active, it means that it is actively used by Power BI for
filtering, data aggregation, and other data modeling operations
• On the other hand, when a relationship is marked as inactive, it is not utilized by Power BI
for data modeling operations
Properties Pane
• The Property Pane in Power BI is a panel that provides options and settings to modify the
properties of various objects in your data model, such as tables, column, Cardinality.
• Adjust the relationship settings as needed
Techniques of Data Modeling part - 2 | Cheat
Sheet
Content
• Filter Flow
• Cross Filter Direction
Filter Flow
• Filter flow in a relationship refers to how filters applied to one table propagate and affect the
data displayed in related tables
• The filter flow allows you to filter data in one table and have those filters affect the data
displayed in connected or related tables.
• The filter flow ensures that the data displayed in visuals, reports, and dashboards is
dynamically filtered based on the relationships established between tables.
• It enables users to explore and analyze data across multiple tables in a cohesive manner.
Single
• Filters applied to the "one" side of the relationship (the table with the one unique value) will
flow to the "many" side (the table with multiple instances of that value).
• However, filters applied to the "many" side will not affect the data in the "one" side.
• This means that the filter flows in a single direction, influencing how the data is displayed in
the related table.
Both
• Filters applied to either the "one" side or the "many" side of the relationship will flow in
both directions.
• This means that filters from one table will affect the data in the other table, and vice versa.
• It allows for bidirectional filtering and analysis, enabling a more comprehensive exploration
of the data.
Single(Table2 to Table1)
Both
After applying all the above steps, the resulting table is below.
4. If you select Both then click Apply security filter in both directions also.
5. Click on OK button.
Contents
• DAX
• How DAX helps to make your data model better
• DAX Table and Column Name Syntax
DAX
• DAX (Data Analysis Expressions) is a formula language used in Power BI and other
Microsoft products like Excel and Analysis Services.
• DAX is a collection of functions, operators, and constants that can be used in a formula, or
expression, to calculate and return one or more values.
• DAX helps you create new information from data already in your model.
Contents
• Measures
• Implicit Measure
• Explicit Measure
• Calculated Columns
Measures
• Measure is a calculation performed on the data in a Power BI model.
• It is a formula that aggregates or calculates values based on specific criteria or conditions.
• Measures are typically used to perform calculations such as sum, average, count, maximum,
minimum, or any other mathematical or statistical operation on the data.
• Measures are defined within a table in the Power BI and can be created using DAX
functions.
• Measures can be reused across multiple reports and visualizations within the data model,
enhancing reusability and simplifying the analysis process.
Implicit Measure
• Implicit measures refer to the automatically generated measures that are created by Power
BI itself based on the data type.
• Power BI automatically determines the aggregation function based on the data type when a
numeric column is dragged onto a visualization field.
• When you add certain fields or columns to a visualization, Power BI automatically applies
an aggregation function (e.g., sum, count, average) to create a default measure.
• This default measure is considered an implicit measure because it is automatically generated
without the need for explicit definition or customization.
Explicit Measure
• An explicit measure is a measure that is explicitly defined by the user using a custom DAX
formula.
• Explicit measures are created with specific calculations and logic defined by the user.
• By creating explicit measures, users can derive more meaningful insights and perform
advanced analyses on their data within Power BI.
• Explicit measures provide greater control and flexibility compared to implicit measures.
Contents
• How to Create Measures
• How to create Calculated Columns
Or
Go to the Table Tools tab in the ribbon of the Data View. Click on the New Measure option in the
Calculations section.
3. A formula bar will appear at the top of the screen. where you can enter your DAX formula for the
measure.
4. After completing the DAX formula, press Enter to create the measure.
The measure will now be available in the Data pane under the corresponding table.
Go to the Table Tools tab in the ribbon of the Data View. Click on the New Column
option in the Calculations section.
3. A formula bar will appear at the top of the screen.where you can enter your DAX formula for the
calculated column.
4. After completing the DAX formula, press Enter to create the calculated column.
Contents
• DAX Syntax
• Operators
• Arithmetic Operators
• Comparison Operators
• Text Concatenation Operators
• Logical Operators
DAX Syntax
It is used to create calculated columns, calculated tables, measures, and other advanced calculations.
The syntax of DAX follows a specific structure.
TotalQuantity = SUM(Sales[OrderQuantity])
This formula includes the following syntax elements:
TotalQuantity - New column name. Operator (=) - The equals sign operator (=), which indicates
the beginning of the formula.
SUM - The DAX function SUM, which adds up all of the numbers in the
Sales[OrderQuantity] column.
Parenthesis () - Parenthesis () which surround an expression that contains one or more arguments.
An argument passes a value to a function.
Sales - The referenced table. [OrderQuantity] - The referenced column, [OrderQuantity], in the
Sales table. With this argument, the SUM function knows on which column to aggregate a SUM.
Operators
Operators are symbols or characters that are used to perform various calculations, comparisons, and
logical operations on data. Operators are an essential component of DAX.
There are four different types of calculation operators:
• Arithmetic operators
• Comparison operators
• Text concatenation operators
• Logical operators
Arithmetic Operators
• Arithmetic operators in DAX are used to perform mathematical calculations on values and
columns in Power BI.
• They allow you to perform basic arithmetic operations such as addition, subtraction,
multiplication and division.
Comparison Operators
• You can compare two values with the following operators. When two values are compared
by using these operators, the result is a logical value, either TRUE or FALSE.
Contents
• Arithmetic Operators
• Comparison Operators
• Text Concatenation Operators
• Logical Operators
Arithmetic Operators
To create calculated column of TotalAmount, follow these steps:
1. Click on the Table Tools tab in the ribbon of the Data View. Click on the New Column
option in the Calculations section.
2. A formula bar will appear at the top of the screen. Where you can enter your DAX formula for
the calculated column.
3. After completing the DAX formula, press Enter to create the calculated column. The calculated
column will now be added to the table.
Comparison Operators
To create calculated column of Profit/Loss, follow these steps:
1. Click on the Table Tools tab in the ribbon of the Data View . Click on the New Colum
option in the Calculations section.
2. A formula bar will appear at the top of the screen. Where you can enter your DAX formula
for the calculated column.
3. After completing the DAX formula, press Enter to create the calculated column. The calculated
column will now be added to the table.
Text Concatenation Operators
To create calculated column of Full Name , follow these steps:
1. Click on the Table Tools tab in the ribbon of the Data View . Click on the New Column
option in the Calculations section.
2. A formula bar will appear at the top of the screen. Where you can enter your DAX formula
for the calculated column.
3. After completing the DAX formula, press Enter to create the calculated column. The calculated
column will now be added to the table.
Logical Operators
To create calculated Discount columns, follow these steps:
1. Click on the Table Tools tab in the ribbon of the Data View. Click on the New Column
option in the Calculations section.
2. A formula bar will appear at the top of the screen. Where you can enter your DAX formula
for the calculated column.
3. After completing the DAX formula, press Enter to create the calculated column. The calculated
column will now be added to the table.
Date and Time Functions | Cheat Sheet
Contents
• DAY Function
• MONTH Function
• YEAR Function
• SECOND Function
• MINUTE Function
• HOUR Function
• TODAY and NOW Function
• WEEKDAY Function
• DATEDIFF Function
DAY Function
• The DAY function in DAX is used to extract the day component from a Date or DateTime
value in Power BI.
• It returns an integer value representing the day of the month.
MONTH Function
• The MONTH function in DAX is used to extract the month component from a Date or
DateTime value.
• It returns an integer value ranging from 1 to 12, representing the month of the year.
YEAR Function
• The YEAR function in DAX is used to extract the year component from a Date or DateTime
value.
• It returns a four-digit integer representing the year.
SECOND Function
• The SECOND function in DAX is used to extract the second component from a given
DateTime or Time value in Power BI.
• It returns an integer value ranging from 0 to 59, representing the second of the specified
time.
• The SECOND function is particularly useful for performing time-based calculations and
extracting specific components from a time value.
MINUTE Function
• The MINUTE function is a Date and Time function in the DAX.
• It is used to extract the minute component from a given time or datetime value.
• The MINUTE function returns an integer value between 0 and 59, representing the minute
portion of the time.
HOUR Function
• The HOUR function is a Date and Time function in the DAX.
• It is used to extract the hour component from a given time or datetime value.
• The function returns an integer value between 0 and 23, representing the hour of the day.
• You can create a new calculated column using the HOUR function to extract the hour from a
time or datetime column.
NOW Function
The NOW function is used to retrieve the current date and time. It returns a DateTime value
representing the current date and time.
Syntax :
NOW()
Return Value The NOW() function returns a DateTime value representing the current date and
time.
WEEKDAY Function
• The WEEKDAY function in DAX is used to determine the day of the week for a given Date
or DateTime value in Power BI.
• It returns an integer value ranging from 1 to 7, representing the day of the week.
• The function allows you to perform various calculations and analysis based on the day of the
week.
Syntax :
WEEKDAY(Date, <Return_type>)
Parameters
Date - The Date or DateTime value for which you want to determine the day of the week. Return
type 1 - week begins on Sunday (1) and ends on Saturday (7). Return type 2 - week begins on
Monday (1) and ends on Sunday (7).
Return Value
The WEEKDAY function returns an integer from 1 to 7 representing the day of the week.
DATEDIFF Function
• The DATEDIFF function in DAX is used to calculate the difference between two dates in
terms of a specified interval.
• It allows you to perform date-based calculations and analyze the duration or time span
between two dates.
Syntax :
DATEDIFF(Start Date, End Date, Interval)
Parameters
Start Date - The starting Date or DateTime value. End Date - The ending Date or DateTime value.
Interval - The interval or unit of time to calculate the difference. It can be one of the following
values: "year", "quarter", "month", "day", "hour", "minute", "second".
Return Value
Returns an integer value representing the difference between the start date and end date in terms of
the specified interval.
Contents
• DAY Function
• SECOND Function
• TODAY Function
• NOW Function
• WEEKDAY Function
• DATEDIFF Function
DAY Function
To use the DAY function, you'll first need to create a calculated column in Power BI. To create
calculated column, follow these steps.
1. Click on the Table Tools tab in the ribbon of the Data View. Click on the New Column
option in the Calculations section.
SECOND Function
To use the SECOND function, you'll first need to create a calculated column in Power BI. To create
calculated column, follow these steps.
1. Click on the Table Tools tab in the ribbon of the Data View . Click on the New Column
option in the Calculations section.
2. In the formula bar, enter the following formula.
3. After completing the DAX formula, press Enter to create the calculated column. The calculated
column will now be added to the table.
TODAY Function
To use the TODAY function, you'll first need to create a calculated column in Power BI. To create
calculated column which contain today date, follow these steps.
1. Click on the Table Tools tab in the ribbon of the Data View. Click on the New Column
option in the Calculations section.
NOW Function
To use the NOW function, you'll first need to create a calculated column in Power BI. To create
calculated column, follow these steps.
1. Click on the Table Tools tab in the ribbon of the Data View. Click on the New Column
option in the Calculations section.
3. After completing the DAX formula, press Enter to create the calculated column. The calculated
column will now be added to the table.
WEEKDAY Function
To use the WEEKDAY function, you'll first need to create a calculated column in Power BI. To
create calculated column, follow these steps.
1. Click on the Table Tools tab in the ribbon of the Data View. Click on the New Column
option in the Calculations section.
2. In the formula bar, enter the following formula.
3. After completing the DAX formula, press Enter to create the calculated column. The calculated
column will now be added to the table.
DATEDIFF Function
To use the DATEDIFF function, you'll first need to create a calculated column in Power BI. To
create calculated column, follow these steps.
1. Click on the Table Tools tab in the ribbon of the Data View. Click on the New Column
option in the Calculations section.
3. After completing the DAX formula, press Enter to create the calculated column. The calculated
column will now be added to the table.
Logical Functions | Cheat Sheet
Contents
• Logical Function
• IF Function
• OR Function
• AND Function
• NOT Function
• IFERROR Function
Logical Function
• The logical functions in DAX are used to perform logical operations and evaluate conditions
within Power BI formulas and expressions.
• These functions help in making logical decisions, filtering data, and performing conditional
calculations.
IF Function
• The IF function in DAX is a conditional function that allows you to perform logical tests
and return different results based on the outcome of the test.
• It is similar to the IF function in other programming languages and Excel.
• The IF function evaluates a specified condition and returns one value if the condition is true
and another value if the condition is false.
Syntax:
IF( logical test, value if true, value if false)
Parameters logical test - A logical expression or condition that evaluates to either true or false. It
can be a column reference, a scalar value, or an expression. value if true - The value or expression
to be returned if the logical test is true. value if false - The value or expression to be returned if the
logical test is false.
Return Value The IF function returns a single value based on the evaluation of the logical_test.
OR Function
• The OR function in DAX is a logical function that allows you to perform a logical OR
operation on multiple conditions.
• It checks whether at least one of the specified conditions is true and returns a Boolean value
of true or false.
• The OR function is commonly used to evaluate multiple conditions and make decisions
based on their collective outcome.
Syntax:
OR(logical1, logical2)
Parameters logical1, logical2 - The conditions or logical expressions that you want to evaluate.
You can specify two or more conditions separated by commas.
Return Value The OR function returns a Boolean value of true if at least one of the conditions
evaluates to true. Otherwise, it returns false.
AND Function
• The AND function in DAX is a logical function that allows you to perform a logical AND
operation on multiple conditions.
• It checks whether all the specified conditions are true and returns a Boolean value of true or
false.
• The AND function is commonly used to evaluate multiple conditions and make decisions
based on their collective outcome.
Syntax:
AND(logical1, logical2)
Parameters logical1, logical2 - The conditions or logical expressions that you want to evaluate.
You can specify two or more conditions separated by commas.
Return Value The AND function returns a Boolean value of true if all the conditions evaluate to
true. Otherwise, it returns false.
NOT Function
• The NOT function in DAX is a logical function that allows you to perform a logical NOT
operation on a single condition.
• It negates the outcome of the specified condition and returns the opposite Boolean value.
• The NOT function is commonly used to reverse the logical result of a condition.
Syntax:
NOT(condition)
Parameter condition - The condition or logical expression that you want to negate. It can be a
column reference, a scalar value, or an expression that evaluates to a Boolean value.
Return Value The NOT function returns a Boolean value of true if the specified condition evaluates
to false. It returns false if the condition evaluates to true.
IFERROR Function
• The IFERROR function in DAX is a conditional function that allows you to handle and
manage errors in your calculations.
• It evaluates an expression and returns a specified value if the expression results in an error.
• The IFERROR function is commonly used to handle errors and display alternative values or
perform alternative calculations when errors occur.
Syntax:
IFERROR(expression, value if error)
Parameters expression - The expression or calculation that you want to evaluate for errors. value if
error - The value or expression to be returned if the expression results in an error.
Return Value The IFERROR function returns the result of the expression if it does not result in an
error. If the expression produces an error, it returns the value specified by value if error.
Contents
• IF Function
• OR Function
• AND Function
• NOT Function
• IFERROR Function
IF Function
To use the IF function, follow these steps.
1. Click on the Table Tools tab in the ribbon of the Data View. Click on the New Column
option in the Calculations section.
3. After completing the DAX formula, press Enter to create the calculated column. The calculated
column will now be added to the table.
OR Function
To use the OR function, follow these steps.
1. Click on the Table Tools tab in the ribbon of the Data View. Click on the New Column
option in the Calculations section.
2. In the formula bar, enter the following formula.
3. After completing the DAX formula, press Enter to create the calculated column. The calculated
column will now be added to the table.
AND Function
To use the AND function, follow these steps.
1. Click on the Table Tools tab in the ribbon of the Data View. Click on the New Column
option in the Calculations section.
2. In the formula bar, enter the following formula.
3. After completing the DAX formula, press Enter to create the calculated column. The calculated
column will now be added to the table.
NOT Function
To use the NOT function, follow these steps.
1. Click on the Table Tools tab in the ribbon of the Data View. Click on the New Column
option in the Calculations section.
2. In the formula bar, enter the following formula.
3. After completing the DAX formula, press Enter to create the calculated column. The calculated
column will now be added to the table.
IFERROR Function
To use the IFERROR function, follow these steps.
1. Click on the Table Tools tab in the ribbon of the Data View. Click on the New Measure
option in the Calculations section.
2. In the formula bar, enter the following formula. Create two different Measures.
3. After completing the DAX formula, press Enter to create the New Measure. The New Measure
will now be added to the Data pane.
4. Create two cards visuals and add DivideResult1 and Divideresult2 measures in the cards fields
from Data Pane.
Contents
• CONCATENATE Function
• LEN Function
• LEFT Function
• MID Function
• RIGHT Function
• UPPER Function
• LOWER Function
• FIND Function
• SUBSTITUTE Function
CONCATENATE Function
• The CONCATENATE function joins two text strings into one text string.
• The joined items can be text, numbers, Boolean values represented as text, or a combination
of those items.
• You can also use a column reference if the column contains appropriate values.
• If you want to use text strings directly, rather than using a column reference, you must
enclose each string in double quotation marks.
Syntax:
CONCATENATE(<text1>, <text2>)
Parameters text1 - The first text string to be joined into a single text string. The string can include
text or numbers. You can also use column references. text2 - The second text string to be joined into
a single text string. The string can include text or numbers. You can also use column references.
Return Value The CONCATENATE function returns a single text string that is the result of
combining the specified text strings.
LEN Function
• LEN function is used to calculate the length of the characters of a text string.
• LEN always counts each character as 1, no matter what the default language setting is.
• If you use LEN with a column that contains non-text values, such as dates or Booleans, the
function implicitly casts the value to text, using the current column format.
Syntax:
LEN(text)
Parameters text: The text whose length you want to find, or a column that contains text. Spaces
count as characters. Return Value A whole number indicating the number of characters in the text
string.
LEFT Function
• The LEFT function is used to extract a specified number of characters from the beginning
(leftmost part) of a text string.
Syntax:
LEFT(<text>, <num_chars>)
Parameters text - The text string containing the characters you want to extract, or a reference to a
column that contains text. num_chars - The number of characters you want LEFT to extract.
Return Value Returns the specified number of characters from the start of a text string.
MID Function
• The MID function is used to extract a specified number of characters from a text string,
starting at a specified position.
Syntax:
MID(<text>, <start_num>, <num_chars>)
Parameters text - The text string from which you want to extract the characters, or a column that
contains text. start_num - The position of the first character you want to extract. num_chars - The
number of characters to return.
Return Value A string of text of the specified length.
RIGHT Function
• The RIGHT function is used to extract a specified number of characters from the end
(rightmost part) of a text string.
Syntax:
RIGHT(<text>, <num_chars>)
Parameters text - The text string that contains the characters you want to extract, or a reference to a
column that contains text. num_chars - The number of characters you want right to extract.
Return Value A text string containing the specified right-most characters.
UPPER Function
• The UPPER function is used to convert a text string to uppercase.
• It is a DAX function that allows you to change the case of text values to all uppercase
letters.
Syntax:
UPPER (<text>)
Parameters text - The text you want converted to uppercase, or a reference to a column that
contains text.
Return Value The UPPER function returns a new text string that is the uppercase version of the
original text string.
LOWER Function
• The LOWER function is used to convert a text string to lowercase.
• It is a DAX function that allows you to change the case of text values to all lowercase
letters.
Syntax:
LOWER(<text>)
Parameters text - The text you want to convert to lowercase, or a reference to a column that
contains text.
Return Value The LOWER function returns a new text string that is the lowercase version of the
original text string.
FIND Function
• The FIND function is used to locate the position of a specific text string within another text
string.
Syntax:
FIND(<find_text>, <within_text><start_num>, <NotFoundValue>)
Parameters find_text - The text you want to find. within_text - The text containing the text you
want to find. start_num - The character at which to start the search. NotFoundValue - The value that
should be returned when the operation does not find a matching text.
Return Value Number that shows the starting point of the text string you want to find.
SUBSTITUTE Function
• the SUBSTITUTE function is used to replace occurrences of a specified text string within
another text string with a new text string.
• If case does not match between text and old_text, SUBSTITUTE will not replace the text.
• The SUBSTITUTE function is case-sensitive.
Syntax:
SUBSTITUTE(<text>, <old_text>, <new_text>)
Parameters text - The text in which you want to substitute characters, or a reference to a column
containing text. old_text - The existing text that you want to replace. new_text - The text you want
to replace old_text with.
Return Value The SUBSTITUTE function returns a new text string with the specified substitutions
made.
Text Functions | Hands On Guide
Contents
• CONCATENATE Function
• LEN Function
• LEFT Function
• MID Function
• RIGHT Function
• LOWER Function
• FIND Function
• SUBSTITUTE Function
CONCATENATE Function
3. After completing the DAX formula, press Enter to create the calculated column. The
calculated column will now be added to the table.
LEN Function
To use the LEN function, follow these steps.
1. Click on the Table Tools tab in the ribbon of the Data View. Click on the New Column
option in the Calculations section.
3. After completing the DAX formula, press Enter to create the calculated column. The
calculated column will now be added to the table.
LEFT Function
To use the LEFT function, follow these steps.
1. Click on the Table Tools tab in the ribbon of the Data View. Click on the New Column
option in the Calculations section.
3. After completing the DAX formula, press Enter to create the calculated column. The
calculated column will now be added to the table.
MID Function
To use the MID function, follow these steps.
1. Click on the Table Tools tab in the ribbon of the Data View. Click on the New Column
option in the Calculations section.
3. After completing the DAX formula, press Enter to create the calculated column. The
calculated column will now be added to the table.
RIGHT Function
To use the RIGHT function, follow these steps.
1. Click on the Table Tools tab in the ribbon of the Data View. Click on the New Column
option in the Calculations section.
2. In the formula bar, enter the following formula.
3. After completing the DAX formula, press Enter to create the calculated column. The
calculated column will now be added to the table.
LOWER Function
To use the LOWER function, follow these steps.
1. Click on the Table Tools tab in the ribbon of the Data View. Click on the New Column
option in the Calculations section.
3. After completing the DAX formula, press Enter to create the calculated column. The
calculated column will now be added to the table.
FIND Function
To use the FIND function, follow these steps.
1. Click on the Table Tools tab in the ribbon of the Data View. Click on the New Column
option in the Calculations section.
2. In the formula bar, enter the following formula.
SUBSTITUTE Function
To use the SUBSTITUTE function, follow these steps.
1. Click on the Table Tools tab in the ribbon of the Data View. Click on the New Column
option in the Calculationssection.
3. After completing the DAX formula, press Enter to create the calculated column. The
calculated column will now be added to the table.
Contents
• ABS Function
• LCM Function
• MOD Function
• RANDBETWEEN Function
• MEDIAN Function
ABS Function
• The ABS function in DAX is a mathematical function that returns the absolute (positive)
value of a number.
• It disregards the sign of the number and always returns its magnitude.
• The ABS function is commonly used to calculate the absolute difference between two values
or to convert negative values to positive values.
Syntax:
ABS(<number>)
Parameters number - The number for which you want the absolute value.
Return Value Returns the absolute value of a number.
LCM Function
• The LCM function in DAX returns the least common multiple of integers.
• The least common multiple is the smallest positive integer that is a multiple of all integer
arguments
Syntax:
LCM(number1, number2, ...)
Parameters number1 - The first integer argument. number2 - The second integer argument.
Return Value Returns the least common multiple of integers.
MOD Function
• The MOD function in DAX is a mathematical function that calculates the remainder when
one number is divided by another.
• It returns the modulus or remainder of the division operation.
• he MOD function is commonly used to perform calculations based on the remainder, such as
identifying even or odd numbers, grouping values into specific ranges, or checking for
divisibility
Syntax:
MOD(<number>, <divisor>)
Parameters number - The number for which you want to find the remainder after the division is
performed. divisor - The number by which you want to divide.
Return Value Returns the remainder after a number is divided by a divisor. The result always has
the same sign as the divisor.
RANDBETWEEN Function
• The RANDBETWEEN function generates a random whole number between a specified
minimum and maximum value.
Syntax:
RANDBETWEEN(<bottom>,<top>)
Parameters Bottom - The smallest integer the function will return. Top - The largest integer the
function will return.
Return Value Returns a random number in the range between two numbers you specify.
MEDIAN Function
• The MEDIAN function in DAX is used to calculate the median value of a given set of
values in Power BI.
• The median is the middle value in a sorted list of numbers or the average of the two middle
values if the list has an even number of values.
• The MEDIAN function helps in analyzing the central tendency of data.
Syntax:
MEDIAN(<column>)
Parameters column - The column that contains the numbers for which the median is to be
computed.
Return Value The MEDIAN function returns the median value from the specified column or
expression.
Math & Statistical Functions | Hands On Guide
Contents
• ABS Function
• LCM Function
• MOD Function
• RANDBETWEEN Function
• MEDIAN Function
ABS Function
LCM Function
To use the LCM function, follow these steps.
1. Click on the Table Tools tab in the ribbon of the Data View. Click on the New Column
option in the Calculations section.
2. In the formula bar, enter the following formula.
3. After completing the DAX formula, press Enter to create the calculated column. The calculated
column will now be added to the table.
MOD Function
To use the MOD function, follow these steps.
1. Click on the Table Tools tab in the ribbon of the Data View. Click on the New Column
option in the Calculations section.
2. In the formula bar, enter the following formula.
3. After completing the DAX formula, press Enter to create the calculated column. The calculated
column will now be added to the table.
RANDBETWEEN Function
To use the RANDBETWEEN function, follow these steps.
1. Click on the Table Tools tab in the ribbon of the Data View. Click on the New Column
option in the Calculations section.
2. In the formula bar, enter the following formula.
3. After completing the DAX formula, press Enter to create the calculated column. The calculated
column will now be added to the table.
MEDIAN Function
To use the MEDIAN function, follow these steps.
1. Click on the Table Tools tab in the ribbon of the Data View. Click on the New Measure
option in the Calculations section.
2. In the formula bar, enter the following formula.
3. After completing the DAX formula, press Enter to create the Measure. The Measure will now be
added to the data pane.
4. To show the MeadianOfQuantity measure, you need to create Card visual and add
MeadianOfQuantity measure in fields pane of card visual.
Contents
• FILTER Function
• ALL Function
• ALLEXCEPT Function
• CALCULATE Function
FILTER Function
• You can use FILTER function to reduce the number of rows in the table that you are
working with, and use only specific data in calculations.
• It allows you to define a subset of a table or column that meets specific criteria.
Syntax:
FILTER(<table>, <filter>)
Parameters table - The table to be filtered. The table can also be an expression that results in a
table. filter - A Boolean expression that is to be evaluated for each row of the table.
Return Value The Filter function returns a table that contains only the rows from the input table or
column that meet the specified condition.
ALL Function
• The
ALL
function allows you to remove or override filters applied to a specific column or table.
• By applying the
ALL
function, you can include all the values from the specified column or table in the calculation,
regardless of the applied filters.
Syntax:
ALL( <table>, [<column>] )
Parameters table - The table that you want to clear filters on. column - The column that you want
to clear filters on.
Return Value Returns all the rows in a table, or all the values in a column, ignoring any filters that
might have been applied.
ALLEXCEPT Function
• It allows you to remove filters from a specified column while keeping filters applied to other
columns or tables.
• The ALLEXCEPT function is useful when you want to exclude filters on certain columns
but retain filters on other columns.
• This function is not used by itself, but serves as an intermediate function that can be used to
change the set of results over which some other calculation is performed.
Syntax:
ALLEXCEPT(<table>,<column>[,<column1>])
Parameters table - The table over which all context filters are removed, except filters on those
columns that are specified in subsequent arguments. column - The column for which context filters
must be preserved.
Return Value Removes all context filters in the table except filters that have been applied to the
specified columns.
CALCULATE Function
• It allows you to modify the context in which a calculation or aggregation is performed,
enabling dynamic calculations based on specific filters, conditions, or expressions.
• The CALCULATE function is used to create complex calculations by applying one or more
filters to a specific expression.
Syntax:
CALCULATE(<expression>, [<filter>])
Parameters expression - The expression to be evaluated. filter - (optional)Boolean expressions or
table expressions that defines filters, or filter modifier functions.
Return Value The value that is the result of the expression.
Contents
• FILTER Function
• ALL Function
• ALLEXCEPT Function
• CALCULATE Function
FILTER Function
To use the FILTER function, follow these steps.
1. Click on the Table Tools tab in the ribbon of the Data View. Click on the New Table
option in the Calculations section.
3. After completing the DAX formula, press Enter to create the new table. The new table will now
be added to the Data pane.
ALL Function
To use the ALL function, follow these steps.
1. Click on the Table Tools tab in the ribbon of the Data View. Click on the New Table
option in the Calculations section.
2. In the formula bar, enter the following formula.
3. After completing the DAX formula, press Enter to create the new table. The new table will now
be added to the Data pane.
ALLEXCEPT Function
To use the ALLEXCEPT function, follow these steps.
1. Click on the Table Tools tab in the ribbon of the Data View. Click on the New Table
option in the Calculations section.
2. In the formula bar, enter the following formula.
3. After completing the DAX formula, press Enter to create the new table. The new table will now
be added to the Data pane.
CALCULATE Function
To use the CALCULATE function, follow these steps.
1. Click on the Table Tools tab in the ribbon of the Data View. Click on the New Measure
option in the Calculations section.
2. In the formula bar, enter the following formula.
3. After completing the DAX formula, press Enter to create the new measure. The new measure
will now be added to the table.
4. create Table visual and add OrderDate column and MultipleQuantity measure in columns field of
table visual.
Time Intelligence Functions | Cheat Sheet
Contents
• DATESBETWEEN Function
• ENDOFMONTH Function
• STARTOFYEAR Function
• NEXTMONTH Function
DATESBETWEEN Function
• The DATESBETWEEN function in Power BI is used to create a date range by specifying a
start and end date.
• It allows you to filter data based on a specific period of time and perform calculations within
that range.
• This function is suited to pass as a filter to the CALCULATE function. Use it to filter an
expression by a custom date range.
Syntax:
DATESBETWEEN(<Dates>, <StartDate>, <EndDate>)
• If StartDate is BLANK, then StartDate will be the earliest value in the Dates column.
• If EndDate is BLANK, then EndDate will be the latest value in the Dates column.
• Dates used as the StartDate and EndDate are inclusive.
Parameters Dates - A date column. StartDate - A date expression. EndDate - A date expression.
Return Value Returns a table that contains a column of dates that begins with a specified start date
and continues until a specified end date.
ENDOFMONTH Function
• The ENDOFMONTH function in Power BI is used to calculate the end date of the month for
a given date.
• The ENDOFMONTH function is helpful when you need to perform calculations or create
reports based on monthly data.
• It will return the date value corresponding to the last day of the month for each date in the
column.
Syntax:
ENDOFMONTH(<dates>)
Parameters dates - A column that contains dates.
Return Value Returns the last date of the month in the current context for the specified column of
dates.
STARTOFYEAR Function
• The STARTOFYEAR function in Power BI is used to calculate the start date of the year for
a given date.
• The STARTOFYEAR function is helpful when you need to perform calculations or create
reports based on yearly data.
• It will return the date value corresponding to the start of the year for each date in the
column.
Syntax:
STARTOFYEAR(<dates>)
Parameters dates - A column that contains dates.
Return Value Returns the first date of the year in the current context for the specified column of
dates.
NEXTMONTH Function
• The NEXTMONTH function in Power BI is used to calculate the date that represents the
next month after a given date.
• It allows you to easily determine the date corresponding to the following month for a
specific date value.
• The NEXTMONTH function is helpful when you need to perform calculations or create
reports based on the next month's data.
Syntax:
NEXTMONTH(<dates>)
Parameters dates - A column containing dates.
Return Value The NEXTMONTH function returns a date value representing the next month after
the provided date expression.
Contents
• DATESBETWEEN Function
• ENDOFMONTH Function
• STARTOFYEAR Function
• NEXTMONTH Function
DATESBETWEEN Function
To use the DATESBETWEEN function, follow these steps.
1. Click on the Table Tools tab in the ribbon of the Data View. Click on the New Table
option in the Calculations section.
2. In the formula bar, enter the following formula.
3. After completing the DAX formula, press Enter to create the new table. The new table will now
be added to the Data pane.
ENDOFMONTH Function
To use the ENDOFMONTH function, follow these steps.
1. Click on the Table Tools tab in the ribbon of the Data View. Click on the New Column
option in the Calculations section.
2. In the formula bar, enter the following formula.
3. After completing the DAX formula, press Enter to create the calculated column. The calculated
column will now be added to the table.
STARTOFYEAR Function
To use the STARTOFYEAR function, follow these steps.
1. Click on the Table Tools tab in the ribbon of the Data View. Click on the New Column
option in the Calculations section.
2. In the formula bar, enter the following formula.
3. After completing the DAX formula, press Enter to create the calculated column. The calculated
column will now be added to the table.
NEXTMONTH Function
To use the NEXTMONTH function, follow these steps.
1. create profitMrgin as a New Column using given formula.
2. Click on the Table Tools tab in the ribbon of the Data View. Click on the New Measure option in
the Calculations section.
3. In the formula bar, enter the following formula. Create two different Measures.
4. After completing the DAX formula, press Enter to create the New Measure. The New Measures
will now be added to the Data pane.
5. Create table visuals, add OrderDate column, ThisMonthProfitMargin and
NextMonthProfitMargin measures in the columns of the table.