๐น 11. Calculate Growth Percentage
๐น 12. Find the Latest Order for Every Customer
๐น 13-14. Inactive Customers & Duplicates
Inactive =
Business defines the rule, SQL calculates it.
Detect duplicates:
๐น 15. Combining Multiple Tables
โ ๏ธ Every additional join can change the number of rows. Always check the grain.
๐น 16. The Most Important Analytical Pattern
1. Filter raw data โ 2. Join tables โ 3. Aggregate to correct grain โ 4. Apply window functions โ 5. Filter analytical result โ 6. Present final output
๐ผ Real-World Business Problems to Practice
Sales: Top 5 products by revenue, Top products within each category, Month with highest sales, Revenue growth by month
Customers: Customers with no orders, declining purchases, most recent purchase, repeat customers, AOV per customer
Operations: Orders taking longer than expected, Products never sold, Duplicate transactions, Most active regions
๐ฏ SQL Interview Challenge: Find the highest-selling product in each category.
๐ง SQL Resources: https://whatsapp.com/channel/0029VanC5rODzgT6TiTGoa1v
Double Tap โค๏ธ For More
(Total_Sales - Previous_Sales) / NULLIF(Previous_Sales, 0) * 100NULLIF() prevents division-by-zero errors.๐น 12. Find the Latest Order for Every Customer
WITH Ranked_Orders AS (
SELECT Customer_ID, Order_ID, Order_Date,
ROW_NUMBER() OVER (PARTITION BY Customer_ID ORDER BY Order_Date DESC) AS rn
FROM Orders
)
SELECT Customer_ID, Order_ID, Order_Date FROM Ranked_Orders WHERE rn = 1;
๐น 13-14. Inactive Customers & Duplicates
Inactive =
MAX(Order_Date) vs 90-day threshold.Business defines the rule, SQL calculates it.
Detect duplicates:
WITH Duplicate_Check AS (
SELECT *, ROW_NUMBER() OVER (PARTITION BY Customer_ID, Order_Date, Sales ORDER BY Order_ID) AS rn
FROM Orders
)
SELECT * FROM Duplicate_Check WHERE rn > 1;
๐น 15. Combining Multiple Tables
SELECT c.Customer_ID, c.Customer_Name, p.Product_Name, oi.Quantity, oi.Sales
FROM Customers c
JOIN Orders o ON c.Customer_ID = o.Customer_ID
JOIN Order_Items oi ON o.Order_ID = oi.Order_ID
JOIN Products p ON oi.Product_ID = p.Product_ID;
โ ๏ธ Every additional join can change the number of rows. Always check the grain.
๐น 16. The Most Important Analytical Pattern
1. Filter raw data โ 2. Join tables โ 3. Aggregate to correct grain โ 4. Apply window functions โ 5. Filter analytical result โ 6. Present final output
๐ผ Real-World Business Problems to Practice
Sales: Top 5 products by revenue, Top products within each category, Month with highest sales, Revenue growth by month
Customers: Customers with no orders, declining purchases, most recent purchase, repeat customers, AOV per customer
Operations: Orders taking longer than expected, Products never sold, Duplicate transactions, Most active regions
๐ฏ SQL Interview Challenge: Find the highest-selling product in each category.
WITH Product_Sales AS (
SELECT Product_ID, Category, SUM(Sales) AS Total_Sales
FROM Product_Sales_Data GROUP BY Product_ID, Category
),
Ranked_Products AS (
SELECT *, RANK() OVER (PARTITION BY Category ORDER BY Total_Sales DESC) AS Sales_Rank
FROM Product_Sales
)
SELECT Product_ID, Category, Total_Sales FROM Ranked_Products WHERE Sales_Rank = 1;
๐ง SQL Resources: https://whatsapp.com/channel/0029VanC5rODzgT6TiTGoa1v
Double Tap โค๏ธ For More
โค10
๐ ๐ง๐ผ๐ฝ ๐ฏ ๐๐ฅ๐๐ ๐ฅ๐ฒ๐๐ผ๐๐ฟ๐ฐ๐ฒ๐ ๐๐ผ ๐๐ฒ๐ฎ๐ฟ๐ป ๐๐ป-๐๐ฒ๐บ๐ฎ๐ป๐ฑ ๐ง๐ฒ๐ฐ๐ต ๐ฆ๐ธ๐ถ๐น๐น๐ ๐ฅ
๐ซ Artificial Intelligence (AI)
๐ Data Analytics
๐ Cybersecurity
๐ ๐๐ป๐ฟ๐ผ๐น๐น ๐ณ๐ผ๐ฟ ๐๐ฅ๐๐ ๐:-
https://pdlink.in/4y2XyN1
๐ฏ Perfect for Students โข Freshers โข Beginners โข Tech Enthusiasts
๐ก Learn for FREE โ Build Skills โ Upgrade Your Career
๐ซ Artificial Intelligence (AI)
๐ Data Analytics
๐ Cybersecurity
๐ ๐๐ป๐ฟ๐ผ๐น๐น ๐ณ๐ผ๐ฟ ๐๐ฅ๐๐ ๐:-
https://pdlink.in/4y2XyN1
๐ฏ Perfect for Students โข Freshers โข Beginners โข Tech Enthusiasts
๐ก Learn for FREE โ Build Skills โ Upgrade Your Career
โค4
๐ Data Analyst Roadmap โ Part 22
๐ Power BI Level 1 โ Introduction to Power BI & Business Intelligence
After learning Excel and SQL, it's time to move into one of the most important tools in the modern Data Analyst toolkit:
Microsoft Power BI
Power BI helps you transform raw data into:
๐ Interactive dashboards
๐ Reports
๐ Business insights
๐ฏ KPIs
๐ Trends and comparisons
๐ผ Decision-making tools
The goal isn't simply to create attractive charts.
The goal is to turn data into information that people can use to make better decisions.
๐น 1. What Is Power BI?
Power BI is Microsoft's business intelligence and
data visualization platform.
It allows you to:
โข Connect to different data sources
โข Clean and transform data
โข Build data models
โข Create calculations
โข Create interactive visualizations
โข Build dashboards and reports
โข Share insights with others
A typical workflow looks like:
Data Sources
โ
Power Query
โ
Data Model
โ
DAX Calculations
โ
Visualizations
โ
Report / Dashboard
โ
Business Insights
๐น 2. Why Should a Data Analyst Learn Power BI?
Companies generate huge amounts of data.
But raw tables aren't easy for business users to understand.
Imagine giving management this:
Date | Region | Product | Sales | Profit
They may have thousands or millions of rows.
Instead, Power BI can turn that data into:
Total Sales: โน12.5 Cr
Profit: โน3.1 Cr
Top Region: West
Top Product: Product A
Monthly Trend: ๐
Sales by Region: Interactive chart
Now decision-makers can understand the situation quickly.
๐น 3. Power BI vs Excel
You already learned Excel in the earlier parts of this roadmap.
Both tools are valuable, but they are commonly used differently.
Excel| Power BI
Spreadsheet-based| BI platform
Great for ad-hoc analysis| Great for interactive reporting
Cell-based calculations| Model + DAX-based calculations
Manual dashboard updates can be common| Reports can refresh from data sources
Excellent for detailed individual analysis| Excellent for scalable business reporting
This doesn't mean:
Power BI replaces Excel.
Strong Data Analysts often use both.
๐น 4. Main Components of Power BI
You should become familiar with the Power BI ecosystem.
The major concepts you'll encounter are:
Power BI Desktop
Used to build reports, transform data, create models, and write DAX.
Power BI Service
Used for publishing, sharing, collaboration, refresh, and managing reports in the cloud.
Power BI Mobile
Allows users to view and interact with reports on mobile devices.
For a beginner, Power BI Desktop is where most hands-on learning starts.
๐น 5. Power BI Desktop Interface
When you open Power BI Desktop, you'll work with several important areas.
Report View
Used to create visualizations and report pages.
Data View
Allows you to inspect the data loaded into your model.
Model View
Shows relationships between tables.
These three views are important because Power BI isn't just a visualization tool.
It's also a data modeling and analytical environment.
๐น 6. Connecting Power BI to Data
Power BI can connect to many sources.
For example:
๐ Excel
๐ CSV
๐๏ธ SQL databases
โ๏ธ Cloud data sources
๐ Web sources
๐ Other business systems
A common beginner workflow is:
Excel/CSV โ Power BI โ Dashboard
๐ Power BI Level 1 โ Introduction to Power BI & Business Intelligence
After learning Excel and SQL, it's time to move into one of the most important tools in the modern Data Analyst toolkit:
Microsoft Power BI
Power BI helps you transform raw data into:
๐ Interactive dashboards
๐ Reports
๐ Business insights
๐ฏ KPIs
๐ Trends and comparisons
๐ผ Decision-making tools
The goal isn't simply to create attractive charts.
The goal is to turn data into information that people can use to make better decisions.
๐น 1. What Is Power BI?
Power BI is Microsoft's business intelligence and
data visualization platform.
It allows you to:
โข Connect to different data sources
โข Clean and transform data
โข Build data models
โข Create calculations
โข Create interactive visualizations
โข Build dashboards and reports
โข Share insights with others
A typical workflow looks like:
Data Sources
โ
Power Query
โ
Data Model
โ
DAX Calculations
โ
Visualizations
โ
Report / Dashboard
โ
Business Insights
๐น 2. Why Should a Data Analyst Learn Power BI?
Companies generate huge amounts of data.
But raw tables aren't easy for business users to understand.
Imagine giving management this:
Date | Region | Product | Sales | Profit
They may have thousands or millions of rows.
Instead, Power BI can turn that data into:
Total Sales: โน12.5 Cr
Profit: โน3.1 Cr
Top Region: West
Top Product: Product A
Monthly Trend: ๐
Sales by Region: Interactive chart
Now decision-makers can understand the situation quickly.
๐น 3. Power BI vs Excel
You already learned Excel in the earlier parts of this roadmap.
Both tools are valuable, but they are commonly used differently.
Excel| Power BI
Spreadsheet-based| BI platform
Great for ad-hoc analysis| Great for interactive reporting
Cell-based calculations| Model + DAX-based calculations
Manual dashboard updates can be common| Reports can refresh from data sources
Excellent for detailed individual analysis| Excellent for scalable business reporting
This doesn't mean:
Power BI replaces Excel.
Strong Data Analysts often use both.
๐น 4. Main Components of Power BI
You should become familiar with the Power BI ecosystem.
The major concepts you'll encounter are:
Power BI Desktop
Used to build reports, transform data, create models, and write DAX.
Power BI Service
Used for publishing, sharing, collaboration, refresh, and managing reports in the cloud.
Power BI Mobile
Allows users to view and interact with reports on mobile devices.
For a beginner, Power BI Desktop is where most hands-on learning starts.
๐น 5. Power BI Desktop Interface
When you open Power BI Desktop, you'll work with several important areas.
Report View
Used to create visualizations and report pages.
Data View
Allows you to inspect the data loaded into your model.
Model View
Shows relationships between tables.
These three views are important because Power BI isn't just a visualization tool.
It's also a data modeling and analytical environment.
๐น 6. Connecting Power BI to Data
Power BI can connect to many sources.
For example:
๐ Excel
๐ CSV
๐๏ธ SQL databases
โ๏ธ Cloud data sources
๐ Web sources
๐ Other business systems
A common beginner workflow is:
Excel/CSV โ Power BI โ Dashboard
โค2
Later, you'll learn how to connect Power BI directly to SQL databases and other enterprise sources.
๐น 7. Importing Data
A typical process is:
Home
โ
Get Data
โ
Choose Source
โ
Select Table/File
โ
Transform Data
โ
Load
Don't immediately start creating charts.
First understand:
What data did I load?
๐น 8. Power Query
Power Query is Power BI's data preparation and transformation engine.
You'll use it to:
โข Remove unwanted columns
โข Rename columns
โข Change data types
โข Remove duplicates
โข Handle missing values
โข Split columns
โข Merge tables
โข Append tables
โข Filter rows
โข Create transformation steps
This is similar to the Power Query work you learned in Excel.
The important idea is:
Power Query prepares the data before analysis.
๐น 9. Power Query vs DAX
This distinction is extremely important.
Power Query
โ Used mainly for data preparation and transformation
DAX
โ Used mainly for calculations and analysis inside the data model
Think:
Power Query
"Prepare the data."
DAX
"Analyze the data."
You'll learn both in detail in later parts.
๐น 10. Data Modeling
Suppose you have:
Sales
โข Order_ID
โข Customer_ID
โข Product_ID
โข Date
โข Sales
Customers
โข Customer_ID
โข Customer_Name
โข Region
Products
โข Product_ID
โข Product_Name
โข Category
Date
โข Date
โข Month
โข Quarter
โข Year
Instead of putting everything into one giant table, Power BI can connect these tables through relationships.
This is called data modeling.
๐น 11. Relationships
For example:
Customers
Customer_ID
โ
Sales
โ
Product_ID
Products
The relationship allows Power BI to understand how tables are connected.
For example:
Customer โ Sales
allows you to analyze sales by customer region.
Product โ Sales
allows you to analyze sales by product category.
๐น 12. Fact Tables and Dimension Tables
A common data-modeling structure is the star schema.
At the center:
โญ Fact Table
Around it:
๐น Dimension Tables
Example:
Customers
Products โ Sales โ Date
Region
The "Sales" table contains business events or measurements.
The dimension tables provide descriptive context.
This structure is extremely important for Power BI.
๐น 13. Measures vs Columns
Another fundamental concept.
Suppose you have:
"Sales"
A calculated column could calculate something for each row.
A measure calculates a value based on the current report context.
Example measure:
Total Sales =
SUM(Sales[Sales_Amount])
When you put this measure into a visual, Power BI calculates it according to the selected:
โข Region
โข Product
โข Date
โข Customer
โข Filters
This makes measures extremely powerful.
๐น 14. Your First Visualization
Suppose you have:
Month| Sales
Jan| 100,000
Feb| 120,000
Mar| 150,000
You could create a line chart.
The chart immediately communicates:
๐ Sales are increasing over time.
But visualization choice matters.
You shouldn't select a chart because it looks attractive.
Choose it because it communicates the business message clearly.
๐น 15. Common Power BI Visuals
You should become familiar with:
๐ Bar Chart
๐ Line Chart
๐ฅง Pie / Donut Chart
๐ข Card
๐ Table
๐ Matrix
๐ฏ KPI
๐บ๏ธ Map
๐ Column Chart
๐๏ธ Slicer
Each visual serves a different analytical purpose.
๐น 16. Cards
Cards are useful for displaying important KPIs.
๐น 7. Importing Data
A typical process is:
Home
โ
Get Data
โ
Choose Source
โ
Select Table/File
โ
Transform Data
โ
Load
Don't immediately start creating charts.
First understand:
What data did I load?
๐น 8. Power Query
Power Query is Power BI's data preparation and transformation engine.
You'll use it to:
โข Remove unwanted columns
โข Rename columns
โข Change data types
โข Remove duplicates
โข Handle missing values
โข Split columns
โข Merge tables
โข Append tables
โข Filter rows
โข Create transformation steps
This is similar to the Power Query work you learned in Excel.
The important idea is:
Power Query prepares the data before analysis.
๐น 9. Power Query vs DAX
This distinction is extremely important.
Power Query
โ Used mainly for data preparation and transformation
DAX
โ Used mainly for calculations and analysis inside the data model
Think:
Power Query
"Prepare the data."
DAX
"Analyze the data."
You'll learn both in detail in later parts.
๐น 10. Data Modeling
Suppose you have:
Sales
โข Order_ID
โข Customer_ID
โข Product_ID
โข Date
โข Sales
Customers
โข Customer_ID
โข Customer_Name
โข Region
Products
โข Product_ID
โข Product_Name
โข Category
Date
โข Date
โข Month
โข Quarter
โข Year
Instead of putting everything into one giant table, Power BI can connect these tables through relationships.
This is called data modeling.
๐น 11. Relationships
For example:
Customers
Customer_ID
โ
Sales
โ
Product_ID
Products
The relationship allows Power BI to understand how tables are connected.
For example:
Customer โ Sales
allows you to analyze sales by customer region.
Product โ Sales
allows you to analyze sales by product category.
๐น 12. Fact Tables and Dimension Tables
A common data-modeling structure is the star schema.
At the center:
โญ Fact Table
Around it:
๐น Dimension Tables
Example:
Customers
Products โ Sales โ Date
Region
The "Sales" table contains business events or measurements.
The dimension tables provide descriptive context.
This structure is extremely important for Power BI.
๐น 13. Measures vs Columns
Another fundamental concept.
Suppose you have:
"Sales"
A calculated column could calculate something for each row.
A measure calculates a value based on the current report context.
Example measure:
Total Sales =
SUM(Sales[Sales_Amount])
When you put this measure into a visual, Power BI calculates it according to the selected:
โข Region
โข Product
โข Date
โข Customer
โข Filters
This makes measures extremely powerful.
๐น 14. Your First Visualization
Suppose you have:
Month| Sales
Jan| 100,000
Feb| 120,000
Mar| 150,000
You could create a line chart.
The chart immediately communicates:
๐ Sales are increasing over time.
But visualization choice matters.
You shouldn't select a chart because it looks attractive.
Choose it because it communicates the business message clearly.
๐น 15. Common Power BI Visuals
You should become familiar with:
๐ Bar Chart
๐ Line Chart
๐ฅง Pie / Donut Chart
๐ข Card
๐ Table
๐ Matrix
๐ฏ KPI
๐บ๏ธ Map
๐ Column Chart
๐๏ธ Slicer
Each visual serves a different analytical purpose.
๐น 16. Cards
Cards are useful for displaying important KPIs.
For example:
โโโโโโโโโโโโโโโโโโโ
โ TOTAL SALES โ
โ โน12.5 Cr โ
โโโโโโโโโโโโโโโโโโโ
Other examples:
Total Profit
Total Customers
Total Orders
Average Order Value
A dashboard should make its most important KPIs easy to find.
๐น 17. Slicers
Slicers allow users to interactively filter a report.
For example:
Region:
[All โผ]
Year:
[2026 โผ]
Category:
[Electronics โผ]
Selecting a region can update multiple visuals on the report page.
This is one of the features that makes Power BI dashboards interactive.
๐น 18. Filters
Power BI provides filtering at different levels.
Common concepts include:
Visual-level filter
Affects one visual.
Page-level filter
Affects visuals on a particular page.
Report-level filter
Can affect the entire report.
Understanding filter behavior becomes extremely important when building complex reports.
๐น 19. Dashboard vs Report
These terms are often confused.
A report can contain multiple pages with interactive visuals.
A dashboard in the Power BI Service is a single-page canvas made from pinned tiles.
In everyday conversation, people sometimes use "dashboard" to mean any Power BI report page.
But technically, they're different concepts.
๐น 20. The Real Purpose of a Power BI Dashboard
A good dashboard should answer business questions.
For example:
Sales Dashboard
ยซHow much are we selling?ยป
ยซWhich regions are performing best?ยป
ยซWhich products drive revenue?ยป
ยซIs revenue increasing or decreasing?ยป
ยซWhere are we underperforming?ยป
The dashboard should make these answers easy to discover.
๐น 21. Common Beginner Mistakes
Avoid:
โ Adding too many visuals
โ Using every available chart type
โ Creating unnecessary colors and decorations
โ Building dashboards before understanding the data
โ Ignoring relationships
โ Creating everything as calculated columns
โ Using measures incorrectly
โ Showing numbers without business context
A professional dashboard should be:
Clear + Accurate + Interactive + Business-focused
๐ Double Tap โค๏ธ For More
โโโโโโโโโโโโโโโโโโโ
โ TOTAL SALES โ
โ โน12.5 Cr โ
โโโโโโโโโโโโโโโโโโโ
Other examples:
Total Profit
Total Customers
Total Orders
Average Order Value
A dashboard should make its most important KPIs easy to find.
๐น 17. Slicers
Slicers allow users to interactively filter a report.
For example:
Region:
[All โผ]
Year:
[2026 โผ]
Category:
[Electronics โผ]
Selecting a region can update multiple visuals on the report page.
This is one of the features that makes Power BI dashboards interactive.
๐น 18. Filters
Power BI provides filtering at different levels.
Common concepts include:
Visual-level filter
Affects one visual.
Page-level filter
Affects visuals on a particular page.
Report-level filter
Can affect the entire report.
Understanding filter behavior becomes extremely important when building complex reports.
๐น 19. Dashboard vs Report
These terms are often confused.
A report can contain multiple pages with interactive visuals.
A dashboard in the Power BI Service is a single-page canvas made from pinned tiles.
In everyday conversation, people sometimes use "dashboard" to mean any Power BI report page.
But technically, they're different concepts.
๐น 20. The Real Purpose of a Power BI Dashboard
A good dashboard should answer business questions.
For example:
Sales Dashboard
ยซHow much are we selling?ยป
ยซWhich regions are performing best?ยป
ยซWhich products drive revenue?ยป
ยซIs revenue increasing or decreasing?ยป
ยซWhere are we underperforming?ยป
The dashboard should make these answers easy to discover.
๐น 21. Common Beginner Mistakes
Avoid:
โ Adding too many visuals
โ Using every available chart type
โ Creating unnecessary colors and decorations
โ Building dashboards before understanding the data
โ Ignoring relationships
โ Creating everything as calculated columns
โ Using measures incorrectly
โ Showing numbers without business context
A professional dashboard should be:
Clear + Accurate + Interactive + Business-focused
๐ Double Tap โค๏ธ For More
โค5
๐ ๐๐ฎ๐๐ฎ ๐๐ป๐ฎ๐น๐๐๐ถ๐ฐ๐ ๐๐ฒ๐ฟ๐๐ถ๐ณ๐ถ๐ฐ๐ฎ๐๐ถ๐ผ๐ป ๐๐ผ๐๐ฟ๐๐ฒ ๐๐ผ ๐๐ฒ๐ ๐ฎ ๐๐ถ๐ด๐ต-๐ฃ๐ฎ๐๐ถ๐ป๐ด ๐๐ผ๐ฏ ๐ถ๐ป ๐ฎ๐ฌ๐ฎ๐ฒ ๐
Build job-ready skills through live online classes, practical assignments and real-world projects.
๐ผ End-to-End Placement Support
๐ค 500+ Partner Companies
๐ 2000+ Students Placed
๐ Highest Salary: โน41 LPA
๐ Get FREE career counselling and check your eligibility!
๐ ๐ฅ๐ฒ๐ด๐ถ๐๐๐ฒ๐ฟ ๐ก๐ผ๐ ๐
https://pdlink.in/45vk5ph
โกPrepare for roles such as Data Analyst, Business Analyst, BI Analyst and Reporting Analyst.
Build job-ready skills through live online classes, practical assignments and real-world projects.
๐ผ End-to-End Placement Support
๐ค 500+ Partner Companies
๐ 2000+ Students Placed
๐ Highest Salary: โน41 LPA
๐ Get FREE career counselling and check your eligibility!
๐ ๐ฅ๐ฒ๐ด๐ถ๐๐๐ฒ๐ฟ ๐ก๐ผ๐ ๐
https://pdlink.in/45vk5ph
โกPrepare for roles such as Data Analyst, Business Analyst, BI Analyst and Reporting Analyst.
โค3
๐ Data Analyst Roadmap โ Part 23
๐ Power BI Level 2 โ Power Query: Data Cleaning & Transformation
Power Query is used in Power BI to clean, transform, and prepare data before building reports.
๐น 1. Open Power Query
In Power BI Desktop:
Home โ Transform Data
This opens the Power Query Editor.
You will mainly work with:
โข Queries
โข Data Preview
โข Applied Steps
๐น 2. Change Data Types
Always check whether columns have the correct data type.
For example:
Customer_ID โ Text
Quantity โ Whole Number
Sales โ Decimal Number
Order_Date โ Date
Incorrect data types can cause problems in calculations and visuals.
๐น 3. Remove Unnecessary Columns
If your dataset contains columns you don't need, remove them.
For example:
Customer_ID
Customer_Name
Email
Phone
Sales
Internal_Code
If your analysis only needs Customer ID, Customer Name, and Sales, remove the rest.
๐น 4. Filter Unnecessary Rows
Power Query can remove or filter:
โข Blank rows
โข Invalid records
โข Test data
โข Unwanted categories
โข Records outside the required period
Always understand the business rule before removing data.
๐น 5. Remove Duplicates
Power Query allows you to remove duplicate values based on selected columns.
For example, if "Customer_ID" should be unique in a Customer table, duplicate IDs should be investigated.
But don't remove duplicates blindly.
A Sales table can naturally contain many rows for the same customer.
๐น 6. Handle Missing Values
You may find:
Blank
NULL
N/A
Unknown
Depending on the situation, you can:
โข Keep the value blank
โข Replace it
โข Remove the record
Don't automatically replace blanks with zero.
For example, a blank discount doesn't always mean a discount of 0.
๐น 7. Clean Text
Data often contains unwanted spaces or inconsistent formatting.
Example:
" Mumbai"
"Mumbai "
"MUMBAI"
Useful Power Query transformations include:
Trim โ Removes unnecessary spaces
Clean โ Removes unwanted non-printable characters
You can also change text to:
โข UPPERCASE
โข lowercase
โข Proper Case
๐น 8. Replace Values
Suppose your data contains:
Mum
Mumbai
MUMBAI
You can replace and standardize values so they are represented consistently.
This is especially useful for:
โข City
โข Region
โข Category
โข Department
โข Status
๐น 9. Split Columns
Suppose you have:
Full Name
John Smith
Sarah Johnson
You can split it into:
First Name | Last Name
John | Smith
Sarah | Johnson
You can split a column using delimiters such as:
โข Space
โข Comma
โข Dash
โข Custom delimiter
๐น 10. Extract Text
You can extract specific parts of a text column.
For example:
john@gmail.com
You could extract:
john
or:
gmail.com
Power Query provides options such as:
โข Text Before Delimiter
โข Text After Delimiter
โข Text Between Delimiters
โข First Characters
โข Last Characters
๐น 11. Conditional Column
You can create categories based on conditions.
For example:
Sales >= 50,000 โ High
Sales >= 20,000 โ Medium
Otherwise โ Low
This is similar to "CASE WHEN" in SQL.
๐น 12. Custom Column
Power Query also allows you to create calculated columns.
For example:
Total Amount = Quantity ร Unit Price
Custom columns use Power Query's formula language, called M.
๐ Power BI Level 2 โ Power Query: Data Cleaning & Transformation
Power Query is used in Power BI to clean, transform, and prepare data before building reports.
๐น 1. Open Power Query
In Power BI Desktop:
Home โ Transform Data
This opens the Power Query Editor.
You will mainly work with:
โข Queries
โข Data Preview
โข Applied Steps
๐น 2. Change Data Types
Always check whether columns have the correct data type.
For example:
Customer_ID โ Text
Quantity โ Whole Number
Sales โ Decimal Number
Order_Date โ Date
Incorrect data types can cause problems in calculations and visuals.
๐น 3. Remove Unnecessary Columns
If your dataset contains columns you don't need, remove them.
For example:
Customer_ID
Customer_Name
Phone
Sales
Internal_Code
If your analysis only needs Customer ID, Customer Name, and Sales, remove the rest.
๐น 4. Filter Unnecessary Rows
Power Query can remove or filter:
โข Blank rows
โข Invalid records
โข Test data
โข Unwanted categories
โข Records outside the required period
Always understand the business rule before removing data.
๐น 5. Remove Duplicates
Power Query allows you to remove duplicate values based on selected columns.
For example, if "Customer_ID" should be unique in a Customer table, duplicate IDs should be investigated.
But don't remove duplicates blindly.
A Sales table can naturally contain many rows for the same customer.
๐น 6. Handle Missing Values
You may find:
Blank
NULL
N/A
Unknown
Depending on the situation, you can:
โข Keep the value blank
โข Replace it
โข Remove the record
Don't automatically replace blanks with zero.
For example, a blank discount doesn't always mean a discount of 0.
๐น 7. Clean Text
Data often contains unwanted spaces or inconsistent formatting.
Example:
" Mumbai"
"Mumbai "
"MUMBAI"
Useful Power Query transformations include:
Trim โ Removes unnecessary spaces
Clean โ Removes unwanted non-printable characters
You can also change text to:
โข UPPERCASE
โข lowercase
โข Proper Case
๐น 8. Replace Values
Suppose your data contains:
Mum
Mumbai
MUMBAI
You can replace and standardize values so they are represented consistently.
This is especially useful for:
โข City
โข Region
โข Category
โข Department
โข Status
๐น 9. Split Columns
Suppose you have:
Full Name
John Smith
Sarah Johnson
You can split it into:
First Name | Last Name
John | Smith
Sarah | Johnson
You can split a column using delimiters such as:
โข Space
โข Comma
โข Dash
โข Custom delimiter
๐น 10. Extract Text
You can extract specific parts of a text column.
For example:
john@gmail.com
You could extract:
john
or:
gmail.com
Power Query provides options such as:
โข Text Before Delimiter
โข Text After Delimiter
โข Text Between Delimiters
โข First Characters
โข Last Characters
๐น 11. Conditional Column
You can create categories based on conditions.
For example:
Sales >= 50,000 โ High
Sales >= 20,000 โ Medium
Otherwise โ Low
This is similar to "CASE WHEN" in SQL.
๐น 12. Custom Column
Power Query also allows you to create calculated columns.
For example:
Total Amount = Quantity ร Unit Price
Custom columns use Power Query's formula language, called M.
โค4
You don't need to master M immediately. Start by understanding the transformations available through the interface.
๐น 13. Merge Queries
Merge Queries combines related tables using a common column.
For example:
Customers
Customer_ID | Customer_Name
101 | John
102 | Sarah
Orders
Order_ID | Customer_ID | Sales
1 | 101 | 5000
2 | 102 | 7000
You can merge them using:
Customer_ID
This is similar to a SQL "JOIN".
๐น 14. Append Queries
Append combines tables by adding rows.
For example:
January Sales
โ
February Sales
โ
March Sales
becomes one table containing all three months.
Remember:
Merge โ Combine columns
Append โ Combine rows
๐น 15. Applied Steps
Power Query records every transformation you perform.
For example:
Source
โ
Changed Type
โ
Removed Columns
โ
Filtered Rows
โ
Trimmed Text
โ
Removed Duplicates
This makes the cleaning process repeatable.
When the source data is refreshed, Power Query can apply the same steps again.
๐น 16. Query Folding
Query Folding is an important performance concept.
When possible, Power Query pushes transformations back to the source system.
For example:
Power BI
โ
Filter 2026 Data
โ
Database performs filtering
โ
Power BI receives required data
This can reduce the amount of data transferred and improve refresh performance.
Query folding depends on the data source and the transformations being used.
๐น 17. Power Query vs SQL vs DAX
Remember this simple difference:
SQL
โ Retrieve and analyze data from databases
Power Query
โ Clean and transform data
DAX
โ Create calculations and analyze data inside the Power BI model
A typical workflow is:
SQL
โ
Get Data
Power Query
โ
Clean & Transform
Data Model
โ
Create Relationships
DAX
โ
Create Measures
Visuals
โ
Build Report
๐ฏ Interview Question
What is the difference between Merge and Append in Power Query?
Merge combines related tables using matching columns.
Append stacks tables with similar structures by adding rows.
Merge โ More columns
Append โ More rows
๐ก Key Lesson
Power Query prepares your data so that your Power BI model and reports are built on clean, reliable data.
๐ Double Tap โค๏ธ For Part-24
๐น 13. Merge Queries
Merge Queries combines related tables using a common column.
For example:
Customers
Customer_ID | Customer_Name
101 | John
102 | Sarah
Orders
Order_ID | Customer_ID | Sales
1 | 101 | 5000
2 | 102 | 7000
You can merge them using:
Customer_ID
This is similar to a SQL "JOIN".
๐น 14. Append Queries
Append combines tables by adding rows.
For example:
January Sales
โ
February Sales
โ
March Sales
becomes one table containing all three months.
Remember:
Merge โ Combine columns
Append โ Combine rows
๐น 15. Applied Steps
Power Query records every transformation you perform.
For example:
Source
โ
Changed Type
โ
Removed Columns
โ
Filtered Rows
โ
Trimmed Text
โ
Removed Duplicates
This makes the cleaning process repeatable.
When the source data is refreshed, Power Query can apply the same steps again.
๐น 16. Query Folding
Query Folding is an important performance concept.
When possible, Power Query pushes transformations back to the source system.
For example:
Power BI
โ
Filter 2026 Data
โ
Database performs filtering
โ
Power BI receives required data
This can reduce the amount of data transferred and improve refresh performance.
Query folding depends on the data source and the transformations being used.
๐น 17. Power Query vs SQL vs DAX
Remember this simple difference:
SQL
โ Retrieve and analyze data from databases
Power Query
โ Clean and transform data
DAX
โ Create calculations and analyze data inside the Power BI model
A typical workflow is:
SQL
โ
Get Data
Power Query
โ
Clean & Transform
Data Model
โ
Create Relationships
DAX
โ
Create Measures
Visuals
โ
Build Report
๐ฏ Interview Question
What is the difference between Merge and Append in Power Query?
Merge combines related tables using matching columns.
Append stacks tables with similar structures by adding rows.
Merge โ More columns
Append โ More rows
๐ก Key Lesson
Power Query prepares your data so that your Power BI model and reports are built on clean, reliable data.
๐ Double Tap โค๏ธ For Part-24
โค6
๐ Data Analyst Roadmap โ Part 24
๐ Power BI Level 3 โ Data Modeling & Relationships
Once your data is clean, the next step is to build a proper data model.
This is where you decide how your tables connect and how Power BI should understand your data.
๐น 1. What Is a Data Model?
A data model is the structure that connects your tables.
For example, you might have:
Sales
Order_ID
Customer_ID
Product_ID
Date
Sales
Quantity
Customers
Customer_ID
Customer_Name
Region
Products
Product_ID
Product_Name
Category
Date
Date
Month
Quarter
Year
These tables are connected through relationships.
๐น 2. Fact Table
A fact table contains business transactions and numerical values.
Example:
Sales
It may contain:
โข Sales Amount
โข Quantity
โข Cost
โข Profit
โข Order ID
Think:
Fact = What happened?
๐น 3. Dimension Table
Dimension tables describe the facts.
Examples:
Customer โ Who?
Product โ What?
Date โ When?
Region โ Where?
For example:
Customer
Customer_ID
Customer_Name
Region
๐น 4. Star Schema
A common Power BI model looks like this:
The fact table is in the middle and dimension tables surround it.
This is called a Star Schema.
๐น 5. Primary Key
A primary key uniquely identifies a record.
For example:
Customer_ID
101
102
103
Each ID identifies one customer.
๐น 6. Foreign Key
The Sales table can contain the same customer multiple times:
Customer_ID
101
101
102
101
103
Here, "Customer_ID" is used to connect Sales with Customers.
So:
Customers โ Primary Key
Sales โ Foreign Key
๐น 7. One-to-Many Relationship
The most common relationship in Power BI is:
One Customer โ Many Sales
This is called a:
1 : * relationship
๐น 8. Why Relationships Matter
Suppose you select:
Region = West
Power BI needs to know which sales belong to customers from the West region.
The relationship allows the filter to travel from:
Customers
โ
Sales
Without a proper relationship, your visuals may show incorrect results.
๐น 9. Cardinality
Cardinality describes how records relate between two tables.
Common types:
1 : * โ One-to-Many
1 : 1 โ One-to-One
โข : * โ Many-to-Many
For most Power BI analytical models, 1-to-many relationships are the most common.
๐น 10. Many-to-Many Relationships
Many-to-many relationships can make models more complicated.
For example:
Customers โ Products
A customer can buy many products.
A product can be purchased by many customers.
Instead of directly connecting them in some cases, a bridge table can be used.
Customers
โ
Bridge Table
โ
Products
๐น 11. Date Table
A proper Date table is extremely important for Power BI.
It can contain:
Date
Day
Month
Month Number
Quarter
Year
Year-Month
For example:
๐ Power BI Level 3 โ Data Modeling & Relationships
Once your data is clean, the next step is to build a proper data model.
This is where you decide how your tables connect and how Power BI should understand your data.
๐น 1. What Is a Data Model?
A data model is the structure that connects your tables.
For example, you might have:
Sales
Order_ID
Customer_ID
Product_ID
Date
Sales
Quantity
Customers
Customer_ID
Customer_Name
Region
Products
Product_ID
Product_Name
Category
Date
Date
Month
Quarter
Year
These tables are connected through relationships.
๐น 2. Fact Table
A fact table contains business transactions and numerical values.
Example:
Sales
It may contain:
โข Sales Amount
โข Quantity
โข Cost
โข Profit
โข Order ID
Think:
Fact = What happened?
๐น 3. Dimension Table
Dimension tables describe the facts.
Examples:
Customer โ Who?
Product โ What?
Date โ When?
Region โ Where?
For example:
Customer
Customer_ID
Customer_Name
Region
๐น 4. Star Schema
A common Power BI model looks like this:
Customers
Products โโโโ Sales โโโโ Date
Region
The fact table is in the middle and dimension tables surround it.
This is called a Star Schema.
๐น 5. Primary Key
A primary key uniquely identifies a record.
For example:
Customer_ID
101
102
103
Each ID identifies one customer.
๐น 6. Foreign Key
The Sales table can contain the same customer multiple times:
Customer_ID
101
101
102
101
103
Here, "Customer_ID" is used to connect Sales with Customers.
So:
Customers โ Primary Key
Sales โ Foreign Key
๐น 7. One-to-Many Relationship
The most common relationship in Power BI is:
One Customer โ Many Sales
Customers Sales
1 *
| |
Customer_ID โโโโโโโโโ Customer_ID
This is called a:
1 : * relationship
๐น 8. Why Relationships Matter
Suppose you select:
Region = West
Power BI needs to know which sales belong to customers from the West region.
The relationship allows the filter to travel from:
Customers
โ
Sales
Without a proper relationship, your visuals may show incorrect results.
๐น 9. Cardinality
Cardinality describes how records relate between two tables.
Common types:
1 : * โ One-to-Many
1 : 1 โ One-to-One
โข : * โ Many-to-Many
For most Power BI analytical models, 1-to-many relationships are the most common.
๐น 10. Many-to-Many Relationships
Many-to-many relationships can make models more complicated.
For example:
Customers โ Products
A customer can buy many products.
A product can be purchased by many customers.
Instead of directly connecting them in some cases, a bridge table can be used.
Customers
โ
Bridge Table
โ
Products
๐น 11. Date Table
A proper Date table is extremely important for Power BI.
It can contain:
Date
Day
Month
Month Number
Quarter
Year
Year-Month
For example:
Date | Month | Quarter | Year
01-Jan-26 | January | Q1 | 2026
02-Jan-26 | January | Q1 | 2026
โค4
This makes time-based analysis much easier.
๐น 12. Why Month Number Is Important
If you display:
January
February
March
April
Power BI may sort month names alphabetically depending on the setup.
You need a:
Month Number
January โ 1
February โ 2
March โ 3
Then sort Month by Month Number.
๐น 13. Understand the Grain
Before creating relationships, ask:
"What does one row represent?"
For example:
Sales table
โ One row = One order
or:
Sales table
โ One row = One order item
These are different grains.
If you don't understand the grain, you can accidentally double-count sales.
๐น 14. Example of a Grain Problem
Suppose one order contains:
Order 1001
Laptop โ โน60,000
Mouse โ โน2,000
The order-item table has two rows.
If you join this with another table incorrectly, the โน62,000 order value could potentially be repeated.
So before creating relationships or calculations:
Always understand the grain of your tables.
๐น 15. Active and Inactive Relationships
Sometimes two tables can have more than one possible relationship.
For example, Sales may contain:
Order_Date
Ship_Date
Both could connect to the Date table.
But Power BI generally allows only one active relationship between the same pair of tables at a time.
The other relationship can be inactive and activated when needed using DAX.
This becomes important when building advanced date analysis.
๐น 16. Filter Direction
Relationships control how filters move between tables.
In a simple star schema:
Customer
โ
Sales
filters usually flow from the dimension toward the fact table.
Avoid using bi-directional filtering everywhere.
It can create:
โข Ambiguous relationships
โข Unexpected results
โข Difficult-to-debug models
โข Performance issues
๐น 17. Don't Create Relationships Just Because Column Names Match
For example:
Customer_ID
appearing in two tables doesn't automatically mean they should be connected.
Check:
โ Same business meaning
โ Compatible data type
โ Correct grain
โ Unique values on the "one" side
โ Correct cardinality
๐ฏ Interview Question
What is the difference between a Fact Table and a Dimension Table?
Fact Table
Contains business transactions and measurable values.
Example:
"Sales, Quantity, Cost"
Dimension Table
Contains descriptive information used to analyze those transactions.
Example:
"Customer, Product, Date, Region"
Easy way to remember:
Fact = What happened
Dimension = Describe what happened
๐ก Key Lesson
Don't build your Power BI visuals before understanding your data model.
A good model makes your calculations easier, your reports more reliable, and your analysis much easier to maintain.
๐ Double Tap โค๏ธ For More
๐น 12. Why Month Number Is Important
If you display:
January
February
March
April
Power BI may sort month names alphabetically depending on the setup.
You need a:
Month Number
January โ 1
February โ 2
March โ 3
Then sort Month by Month Number.
๐น 13. Understand the Grain
Before creating relationships, ask:
"What does one row represent?"
For example:
Sales table
โ One row = One order
or:
Sales table
โ One row = One order item
These are different grains.
If you don't understand the grain, you can accidentally double-count sales.
๐น 14. Example of a Grain Problem
Suppose one order contains:
Order 1001
Laptop โ โน60,000
Mouse โ โน2,000
The order-item table has two rows.
If you join this with another table incorrectly, the โน62,000 order value could potentially be repeated.
So before creating relationships or calculations:
Always understand the grain of your tables.
๐น 15. Active and Inactive Relationships
Sometimes two tables can have more than one possible relationship.
For example, Sales may contain:
Order_Date
Ship_Date
Both could connect to the Date table.
But Power BI generally allows only one active relationship between the same pair of tables at a time.
The other relationship can be inactive and activated when needed using DAX.
This becomes important when building advanced date analysis.
๐น 16. Filter Direction
Relationships control how filters move between tables.
In a simple star schema:
Customer
โ
Sales
filters usually flow from the dimension toward the fact table.
Avoid using bi-directional filtering everywhere.
It can create:
โข Ambiguous relationships
โข Unexpected results
โข Difficult-to-debug models
โข Performance issues
๐น 17. Don't Create Relationships Just Because Column Names Match
For example:
Customer_ID
appearing in two tables doesn't automatically mean they should be connected.
Check:
โ Same business meaning
โ Compatible data type
โ Correct grain
โ Unique values on the "one" side
โ Correct cardinality
๐ฏ Interview Question
What is the difference between a Fact Table and a Dimension Table?
Fact Table
Contains business transactions and measurable values.
Example:
"Sales, Quantity, Cost"
Dimension Table
Contains descriptive information used to analyze those transactions.
Example:
"Customer, Product, Date, Region"
Easy way to remember:
Fact = What happened
Dimension = Describe what happened
๐ก Key Lesson
Don't build your Power BI visuals before understanding your data model.
A good model makes your calculations easier, your reports more reliable, and your analysis much easier to maintain.
๐ Double Tap โค๏ธ For More
โค8
๐ ๐ง๐ผ๐ฝ ๐๐ป-๐๐ฒ๐บ๐ฎ๐ป๐ฑ ๐๐ฅ๐๐ ๐๐ฒ๐ฟ๐๐ถ๐ณ๐ถ๐ฐ๐ฎ๐๐ถ๐ผ๐ป๐ ๐๐ผ ๐ ๐ฎ๐๐๐ฒ๐ฟ ๐ถ๐ป ๐ฎ๐ฌ๐ฎ๐ฒ ๐ฅ
Explore these FREE certification courses in todayโs most in-demand technology fields:
๐ ๐๐ฎ๐๐ฎ ๐๐ป๐ฎ๐น๐๐๐ถ๐ฐ๐ :- https://pdlink.in/4eRA6eF
๐ป ๐ช๐ฒ๐ฏ ๐๐ฒ๐๐ฒ๐น๐ผ๐ฝ๐บ๐ฒ๐ป๐ :- https://pdlink.in/4gP18Eo
๐ซ ๐๐ฟ๐๐ถ๐ณ๐ถ๐ฐ๐ถ๐ฎ๐น ๐๐ป๐๐ฒ๐น๐น๐ถ๐ด๐ฒ๐ป๐ฐ๐ฒ :- https://pdlink.in/45HWa5Q
โ๏ธ ๐๐น๐ผ๐๐ฑ ๐๐ผ๐บ๐ฝ๐๐๐ถ๐ป๐ด :- https://pdlink.in/4zrksPn
๐ง ๐๐ช๐ฆ :- https://pdlink.in/4j4Jxtv
๐ก๏ธ ๐๐๐ฏ๐ฒ๐ฟ๐๐ฒ๐ฐ๐๐ฟ๐ถ๐๐ & ๐๐๐๐ฟ๐ฒ :- https://pdlink.in/4f0GNuH
โก Start learning today and prepare yourself for better career opportunities in 2026!
Explore these FREE certification courses in todayโs most in-demand technology fields:
๐ ๐๐ฎ๐๐ฎ ๐๐ป๐ฎ๐น๐๐๐ถ๐ฐ๐ :- https://pdlink.in/4eRA6eF
๐ป ๐ช๐ฒ๐ฏ ๐๐ฒ๐๐ฒ๐น๐ผ๐ฝ๐บ๐ฒ๐ป๐ :- https://pdlink.in/4gP18Eo
๐ซ ๐๐ฟ๐๐ถ๐ณ๐ถ๐ฐ๐ถ๐ฎ๐น ๐๐ป๐๐ฒ๐น๐น๐ถ๐ด๐ฒ๐ป๐ฐ๐ฒ :- https://pdlink.in/45HWa5Q
โ๏ธ ๐๐น๐ผ๐๐ฑ ๐๐ผ๐บ๐ฝ๐๐๐ถ๐ป๐ด :- https://pdlink.in/4zrksPn
๐ง ๐๐ช๐ฆ :- https://pdlink.in/4j4Jxtv
๐ก๏ธ ๐๐๐ฏ๐ฒ๐ฟ๐๐ฒ๐ฐ๐๐ฟ๐ถ๐๐ & ๐๐๐๐ฟ๐ฒ :- https://pdlink.in/4f0GNuH
โก Start learning today and prepare yourself for better career opportunities in 2026!
โค1
Preparing for a SQL interview?
Focus on mastering these essential topics:
1. Joins: Get comfortable with inner, left, right, and outer joins.
Knowing when to use what kind of join is important!
2. Window Functions: Understand when to use
ROW_NUMBER, RANK(), DENSE_RANK(), LAG, and LEAD for complex analytical queries.
3. Query Execution Order: Know the sequence from FROM to
ORDER BY. This is crucial for writing efficient, error-free queries.
4. Common Table Expressions (CTEs): Use CTEs to simplify and structure complex queries for better readability.
5. Aggregations & Window Functions: Combine aggregate functions with window functions for in-depth data analysis.
6. Subqueries: Learn how to use subqueries effectively within main SQL statements for complex data manipulations.
7. Handling NULLs: Be adept at managing NULL values to ensure accurate data processing and avoid potential pitfalls.
8. Indexing: Understand how proper indexing can significantly boost query performance.
9. GROUP BY & HAVING: Master grouping data and filtering groups with HAVING to refine your query results.
10. String Manipulation Functions: Get familiar with string functions like CONCAT, SUBSTRING, and REPLACE to handle text data efficiently.
11. Set Operations: Know how to use UNION, INTERSECT, and EXCEPT to combine or compare result sets.
12. Optimizing Queries: Learn techniques to optimize your queries for performance, especially with large datasets.
Here you can find essential SQL Interview Resources๐
https://whatsapp.com/channel/0029VanC5rODzgT6TiTGoa1v
Like this post if you need more ๐โค๏ธ
Hope it helps :)
Focus on mastering these essential topics:
1. Joins: Get comfortable with inner, left, right, and outer joins.
Knowing when to use what kind of join is important!
2. Window Functions: Understand when to use
ROW_NUMBER, RANK(), DENSE_RANK(), LAG, and LEAD for complex analytical queries.
3. Query Execution Order: Know the sequence from FROM to
ORDER BY. This is crucial for writing efficient, error-free queries.
4. Common Table Expressions (CTEs): Use CTEs to simplify and structure complex queries for better readability.
5. Aggregations & Window Functions: Combine aggregate functions with window functions for in-depth data analysis.
6. Subqueries: Learn how to use subqueries effectively within main SQL statements for complex data manipulations.
7. Handling NULLs: Be adept at managing NULL values to ensure accurate data processing and avoid potential pitfalls.
8. Indexing: Understand how proper indexing can significantly boost query performance.
9. GROUP BY & HAVING: Master grouping data and filtering groups with HAVING to refine your query results.
10. String Manipulation Functions: Get familiar with string functions like CONCAT, SUBSTRING, and REPLACE to handle text data efficiently.
11. Set Operations: Know how to use UNION, INTERSECT, and EXCEPT to combine or compare result sets.
12. Optimizing Queries: Learn techniques to optimize your queries for performance, especially with large datasets.
Here you can find essential SQL Interview Resources๐
https://whatsapp.com/channel/0029VanC5rODzgT6TiTGoa1v
Like this post if you need more ๐โค๏ธ
Hope it helps :)
โค4
๐ Data Analyst Roadmap โ Part 25
๐ Power BI Level 4 โ DAX Fundamentals: Measures, Calculated Columns & Filter Context
Now that you understand Power Query and Data Modeling, it's time to learn one of the most important parts of Power BI:
DAX โ Data Analysis Expressions
DAX is the formula language used in Power BI to create calculations.
๐น 1. What Is DAX?
DAX is used to create:
โข Measures
โข Calculated columns
โข Calculated tables
For example:
Total Sales = SUM(Sales[Sales_Amount])
This simple measure can become the foundation for many Power BI reports.
๐น 2. Measures vs Calculated Columns
This is one of the most common Power BI interview questions.
โข
Calculated Column: Calculates a value for each row.
โข Example: Profit = Sales[Sales_Amount] - Sales[Cost]
โข If there are 1 million rows, the column contains a result for each row.
โข
Measure: Calculates a result when it is used in a visual.
โข Example: Total Sales = SUM(Sales[Sales_Amount])
โข A measure can change depending on the filters and selections in the report.
๐น 3. Simple Example
Suppose your Sales table contains:
โข Product: Laptop | Sales: 80,000 | Cost: 60,000
โข Product: Mouse | Sales: 2,000 | Cost: 1,000
โข
Product: Keyboard | Sales: 4,000 | Cost: 2,500
โข
Calculated column: Profit = Sales[Sales] - Sales[Cost]
calculates profit for every row.
โข
Measure: Total Profit = SUM(Sales[Sales]) - SUM(Sales[Cost])
calculates the total based on the current filter context.
๐น 4. Basic Aggregation Functions
Some DAX functions you'll use constantly are:
โข SUM(), AVERAGE(), MIN(), MAX(), COUNT(), COUNTROWS(), DISTINCTCOUNT()
Examples:
โข Total Sales = SUM(Sales[Sales])
โข Average Sales = AVERAGE(Sales[Sales])
โข Total Orders = COUNTROWS(Sales)
โข Total Customers = DISTINCTCOUNT(Sales[Customer_ID])
๐น 5. Why DISTINCTCOUNT() Matters
Suppose the same customer placed 10 orders.
COUNT() could count all transaction rows. But DISTINCTCOUNT(Sales[Customer_ID]) counts the customer only once.
So if you want "How many unique customers do we have?"
DISTINCTCOUNT() is often the right choice.
๐น 6. Creating Your First Measure
In Power BI: Modeling โ New Measure
Then write:
Total Sales = SUM(Sales[Sales_Amount])
You can then drag Total Sales into a Card visual. Result might show:
TOTAL SALES โน12.5 Cr
๐น 7. Measures Respond to Filters
This is where DAX becomes powerful.
Suppose your report contains Total Sales = โน10 Crore. Now select Region = West. The same measure Total Sales = SUM(Sales[Sales_Amount]) may now show โน3 Crore.
You didn't create another measure. The filter changed the calculation. This is called Filter Context.
๐น 8. What Is Filter Context?
Filter context means: The filters currently affecting a DAX calculation.
Filters can come from:
โข Slicers, Visuals, Rows and columns, Page filters, Report filters, Relationships, DAX expressions
For example: Region = West, Year = 2026, Category = Electronics. The Total Sales measure calculates only within that context.
๐น 9. A Simple Way to Understand Filter Context
Think of it like this:
โข Total Sales โ Which rows are currently visible? โ Apply filters โ Calculate SUM
This concept is extremely important.
๐ Power BI Level 4 โ DAX Fundamentals: Measures, Calculated Columns & Filter Context
Now that you understand Power Query and Data Modeling, it's time to learn one of the most important parts of Power BI:
DAX โ Data Analysis Expressions
DAX is the formula language used in Power BI to create calculations.
๐น 1. What Is DAX?
DAX is used to create:
โข Measures
โข Calculated columns
โข Calculated tables
For example:
Total Sales = SUM(Sales[Sales_Amount])
This simple measure can become the foundation for many Power BI reports.
๐น 2. Measures vs Calculated Columns
This is one of the most common Power BI interview questions.
โข
Calculated Column: Calculates a value for each row.
โข Example: Profit = Sales[Sales_Amount] - Sales[Cost]
โข If there are 1 million rows, the column contains a result for each row.
โข
Measure: Calculates a result when it is used in a visual.
โข Example: Total Sales = SUM(Sales[Sales_Amount])
โข A measure can change depending on the filters and selections in the report.
๐น 3. Simple Example
Suppose your Sales table contains:
โข Product: Laptop | Sales: 80,000 | Cost: 60,000
โข Product: Mouse | Sales: 2,000 | Cost: 1,000
โข
Product: Keyboard | Sales: 4,000 | Cost: 2,500
โข
Calculated column: Profit = Sales[Sales] - Sales[Cost]
calculates profit for every row.
โข
Measure: Total Profit = SUM(Sales[Sales]) - SUM(Sales[Cost])
calculates the total based on the current filter context.
๐น 4. Basic Aggregation Functions
Some DAX functions you'll use constantly are:
โข SUM(), AVERAGE(), MIN(), MAX(), COUNT(), COUNTROWS(), DISTINCTCOUNT()
Examples:
โข Total Sales = SUM(Sales[Sales])
โข Average Sales = AVERAGE(Sales[Sales])
โข Total Orders = COUNTROWS(Sales)
โข Total Customers = DISTINCTCOUNT(Sales[Customer_ID])
๐น 5. Why DISTINCTCOUNT() Matters
Suppose the same customer placed 10 orders.
COUNT() could count all transaction rows. But DISTINCTCOUNT(Sales[Customer_ID]) counts the customer only once.
So if you want "How many unique customers do we have?"
DISTINCTCOUNT() is often the right choice.
๐น 6. Creating Your First Measure
In Power BI: Modeling โ New Measure
Then write:
Total Sales = SUM(Sales[Sales_Amount])
You can then drag Total Sales into a Card visual. Result might show:
TOTAL SALES โน12.5 Cr
๐น 7. Measures Respond to Filters
This is where DAX becomes powerful.
Suppose your report contains Total Sales = โน10 Crore. Now select Region = West. The same measure Total Sales = SUM(Sales[Sales_Amount]) may now show โน3 Crore.
You didn't create another measure. The filter changed the calculation. This is called Filter Context.
๐น 8. What Is Filter Context?
Filter context means: The filters currently affecting a DAX calculation.
Filters can come from:
โข Slicers, Visuals, Rows and columns, Page filters, Report filters, Relationships, DAX expressions
For example: Region = West, Year = 2026, Category = Electronics. The Total Sales measure calculates only within that context.
๐น 9. A Simple Way to Understand Filter Context
Think of it like this:
โข Total Sales โ Which rows are currently visible? โ Apply filters โ Calculate SUM
This concept is extremely important.
โค4
If you understand filter context, you'll understand much more advanced DAX later.
๐น 10. CALCULATE()
One of the most important DAX functions is CALCULATE(). It evaluates an expression after modifying the filter context.
For example:
West Sales = CALCULATE([Total Sales], Customers[Region] = "West")
This calculates sales specifically for the West region.
๐น 11. Why CALCULATE() Is So Important
Many advanced DAX calculations are built around CALCULATE().
It is commonly used for:
โข Conditional calculations, Time intelligence, Comparisons, Removing filters, Adding filters, Changing filter context
Learning CALCULATE() properly is one of the biggest milestones in Power BI.
๐น 12. Measures Can Use Other Measures
You don't need to repeat the same logic everywhere.
โข Total Sales = SUM(Sales[Sales_Amount])
โข Total Cost = SUM(Sales[Cost])
โข Total Profit = [Total Sales] - [Total Cost]
This makes your model easier to maintain.
๐น 13. Profit Margin
You can create:
Profit Margin = DIVIDE([Total Profit], [Total Sales])
DIVIDE() is generally safer than manually using "/" because it handles division-by-zero cases more gracefully.
๐น 14. DIVIDE() vs "/"
Instead of [Total Profit] / [Total Sales] prefer:
Profit Margin = DIVIDE([Total Profit], [Total Sales], 0)
You can also specify an alternate result (0) when denominator is zero.
๐น 15. Calculated Column vs Measure โ When to Use Which?
Simple rule:
โข Use a calculated column when you need a value stored for each row. Examples: Profit per transaction, Customer category, Product classification
โข Use a measure when you need an aggregated or dynamically calculated result. Examples: Total Sales, Total Profit, Profit Margin, Average Order Value, Sales Growth %
For most report-level KPIs, measures are usually preferred.
๐น 16. Row Context
Calculated columns work with row context.
For example: Profit = Sales[Sales_Amount] - Sales[Cost]
Power BI evaluates this expression for each row. Think: Row Context = "Which row am I currently calculating?"
๐น 17. Filter Context vs Row Context
โข Row Context โ Focuses on the current row
โข Filter Context โ Defines which data is included in a calculation
Simple example: Calculated Column โ Row by row. Measure โ Based on current filter context.
Understanding this distinction is essential before moving into advanced DAX.
๐น 18. COUNTROWS()
COUNTROWS() counts rows in a table.
Example: Total Orders = COUNTROWS(Sales)
If one row represents one order, this can represent order count. But if your table contains multiple rows per order, it may not. In that situation: Total Orders = DISTINCTCOUNT(Sales[Order_ID]) may be more appropriate.
Always understand the grain of your table.
๐น 19. RELATED()
RELATED() can retrieve a value from a related table when working in row context.
For example: Region = RELATED(Customers[Region])
This can bring the customer's region into a row-level calculation when the relationship and model support it.
๐น 20. Don't Create Everything as a Calculated Column
A common beginner mistake is creating columns for every calculation.
For example: Total Sales, Total Profit, Average Sales, Profit Margin, Sales Growth
๐น 10. CALCULATE()
One of the most important DAX functions is CALCULATE(). It evaluates an expression after modifying the filter context.
For example:
West Sales = CALCULATE([Total Sales], Customers[Region] = "West")
This calculates sales specifically for the West region.
๐น 11. Why CALCULATE() Is So Important
Many advanced DAX calculations are built around CALCULATE().
It is commonly used for:
โข Conditional calculations, Time intelligence, Comparisons, Removing filters, Adding filters, Changing filter context
Learning CALCULATE() properly is one of the biggest milestones in Power BI.
๐น 12. Measures Can Use Other Measures
You don't need to repeat the same logic everywhere.
โข Total Sales = SUM(Sales[Sales_Amount])
โข Total Cost = SUM(Sales[Cost])
โข Total Profit = [Total Sales] - [Total Cost]
This makes your model easier to maintain.
๐น 13. Profit Margin
You can create:
Profit Margin = DIVIDE([Total Profit], [Total Sales])
DIVIDE() is generally safer than manually using "/" because it handles division-by-zero cases more gracefully.
๐น 14. DIVIDE() vs "/"
Instead of [Total Profit] / [Total Sales] prefer:
Profit Margin = DIVIDE([Total Profit], [Total Sales], 0)
You can also specify an alternate result (0) when denominator is zero.
๐น 15. Calculated Column vs Measure โ When to Use Which?
Simple rule:
โข Use a calculated column when you need a value stored for each row. Examples: Profit per transaction, Customer category, Product classification
โข Use a measure when you need an aggregated or dynamically calculated result. Examples: Total Sales, Total Profit, Profit Margin, Average Order Value, Sales Growth %
For most report-level KPIs, measures are usually preferred.
๐น 16. Row Context
Calculated columns work with row context.
For example: Profit = Sales[Sales_Amount] - Sales[Cost]
Power BI evaluates this expression for each row. Think: Row Context = "Which row am I currently calculating?"
๐น 17. Filter Context vs Row Context
โข Row Context โ Focuses on the current row
โข Filter Context โ Defines which data is included in a calculation
Simple example: Calculated Column โ Row by row. Measure โ Based on current filter context.
Understanding this distinction is essential before moving into advanced DAX.
๐น 18. COUNTROWS()
COUNTROWS() counts rows in a table.
Example: Total Orders = COUNTROWS(Sales)
If one row represents one order, this can represent order count. But if your table contains multiple rows per order, it may not. In that situation: Total Orders = DISTINCTCOUNT(Sales[Order_ID]) may be more appropriate.
Always understand the grain of your table.
๐น 19. RELATED()
RELATED() can retrieve a value from a related table when working in row context.
For example: Region = RELATED(Customers[Region])
This can bring the customer's region into a row-level calculation when the relationship and model support it.
๐น 20. Don't Create Everything as a Calculated Column
A common beginner mistake is creating columns for every calculation.
For example: Total Sales, Total Profit, Average Sales, Profit Margin, Sales Growth
โค3
These are generally better candidates for measures, because they need to respond dynamically to report filters.
๐ฏ Power BI Interview Questions
โข
What is DAX? DAX is the formula language used in Power BI for analytical calculations.
โข
What is the difference between a calculated column and a measure? A calculated column calculates values row by row and stores them in the model. A measure calculates dynamically based on the current filter context.
โข
What is filter context? The set of filters affecting a DAX calculation.
โข
What is row context? The current row being evaluated, particularly relevant to calculated columns and certain DAX iterators.
โข
What does CALCULATE() do? It evaluates an expression after modifying the filter context.
โข
Why use DIVIDE()? It provides safer division handling, especially when the denominator can be zero or blank.
๐ฏ Practice Task
Create these measures in a sample Sales model:
โข Total Sales = SUM(Sales[Sales_Amount])
โข Total Cost = SUM(Sales[Cost])
โข Total Profit = [Total Sales] - [Total Cost]
โข Profit Margin = DIVIDE([Total Profit], [Total Sales])
Then create Cards for each measure. Add a Region slicer. Change the region and observe what happens. This is one of the easiest ways to understand filter context practically.
๐ก The biggest DAX concept to understand at this stage is: A measure doesn't simply calculate a number. It calculates a number based on the current context of your report.
Power BI Resources: https://whatsapp.com/channel/0029Vai1xKf1dAvuk6s1v22c
Double Tap โค๏ธ For Part-5
๐ฏ Power BI Interview Questions
โข
What is DAX? DAX is the formula language used in Power BI for analytical calculations.
โข
What is the difference between a calculated column and a measure? A calculated column calculates values row by row and stores them in the model. A measure calculates dynamically based on the current filter context.
โข
What is filter context? The set of filters affecting a DAX calculation.
โข
What is row context? The current row being evaluated, particularly relevant to calculated columns and certain DAX iterators.
โข
What does CALCULATE() do? It evaluates an expression after modifying the filter context.
โข
Why use DIVIDE()? It provides safer division handling, especially when the denominator can be zero or blank.
๐ฏ Practice Task
Create these measures in a sample Sales model:
โข Total Sales = SUM(Sales[Sales_Amount])
โข Total Cost = SUM(Sales[Cost])
โข Total Profit = [Total Sales] - [Total Cost]
โข Profit Margin = DIVIDE([Total Profit], [Total Sales])
Then create Cards for each measure. Add a Region slicer. Change the region and observe what happens. This is one of the easiest ways to understand filter context practically.
๐ก The biggest DAX concept to understand at this stage is: A measure doesn't simply calculate a number. It calculates a number based on the current context of your report.
Power BI Resources: https://whatsapp.com/channel/0029Vai1xKf1dAvuk6s1v22c
Double Tap โค๏ธ For Part-5
โค5
๐ง๐ผ๐ฝ ๐ญ๐ฑ ๐ฃ๐๐๐ต๐ผ๐ป ๐๐ป๐๐ฒ๐ฟ๐๐ถ๐ฒ๐ ๐ค๐๐ฒ๐๐๐ถ๐ผ๐ป๐ ๐ฌ๐ผ๐ ๐ ๐จ๐ฆ๐ง ๐๐ป๐ผ๐! ๐ฅ
Preparing for a Python Developer or Data Analyst interview?
Strengthen your fundamentals with these essential interview topics.
๐ฏ Perfect for Students โข Freshers โข Python Learners โข Data Analyst Aspirants
๐ ๐๐ฒ๐ ๐๐ต๐ฒ ๐๐ป๐๐ฒ๐ฟ๐๐ถ๐ฒ๐ ๐ค๐๐ฒ๐๐๐ถ๐ผ๐ป๐ ๐
https://pdlink.in/3TAUwk7
๐Save this for your next interview and share it with a friend!
Preparing for a Python Developer or Data Analyst interview?
Strengthen your fundamentals with these essential interview topics.
๐ฏ Perfect for Students โข Freshers โข Python Learners โข Data Analyst Aspirants
๐ ๐๐ฒ๐ ๐๐ต๐ฒ ๐๐ป๐๐ฒ๐ฟ๐๐ถ๐ฒ๐ ๐ค๐๐ฒ๐๐๐ถ๐ผ๐ป๐ ๐
https://pdlink.in/3TAUwk7
๐Save this for your next interview and share it with a friend!
๐ Data Analyst Roadmap โ Part 26
POWER BI LEVEL 5 โ DAX: CALCULATE(), FILTERS & CONTEXT
If you understand CALCULATE(), DAX becomes much easier.
The most important idea:
๐ CALCULATE() changes the filter context in which a measure is evaluated.
Example:
Total Sales =
SUM(Sales)[SalesAmount]
Now suppose you want sales only for the West region:
West Sales = CALCULATE( [Total Sales], Sales[Region] = "West" )
CALCULATE() takes the existing calculation and applies an additional filter.
๐น 1. CALCULATE() with multiple filters
You can apply multiple conditions:
West Electronics Sales = CALCULATE( [Total Sales], Sales[Region] = "West", Sales[Category] = "Electronics" )
This calculates sales where:
Region = West
AND
Category = Electronics
๐น 2. REMOVEFILTERS()
Sometimes you don't want a slicer or visual filter to affect your calculation.
Example:
Total Sales All Regions = CALCULATE( [Total Sales], REMOVEFILTERS(Sales[Region]) )
If a report is filtered to:
Region โ West
this measure still shows sales across all regions.
๐น 3. ALL()
ALL() can also remove filters.
Example:
Total Sales All Regions = CALCULATE( [Total Sales], ALL(Sales[Region]) )
A common use is calculating percentage of total.
Sales % of Total = DIVIDE( [Total Sales], CALCULATE( [Total Sales], ALL(Sales[Region]) ) )
If West has โน20 lakh sales and all regions have โน100 lakh:
Sales % of Total = 20%
๐น 4. ALLSELECTED()
ALLSELECTED() is useful when you want to respect the user's overall selections but ignore a visual-level grouping.
Example:
Sales % of Selected Regions = DIVIDE( [Total Sales], CALCULATE( [Total Sales], ALLSELECTED(Sales[Region]) ) )
If the user selects:
West + South
the calculation can compare each region against the total of the selected regions rather than the entire dataset.
๐น 5. KEEPFILTERS()
By default, CALCULATE() can replace an existing filter on the same column.
KEEPFILTERS() tells DAX to preserve the existing filter and apply the new condition on top of it.
Example:
CALCULATE( [Total Sales], KEEPFILTERS(Sales[Category] = "Electronics") )
Think of it as:
Existing filters
+
New filter
instead of replacing the existing filter.
๐น 6. FILTER()
FILTER() creates a filtered table based on a condition.
Example:
High Value Sales = CALCULATE( [Total Sales], FILTER( Sales, Sales[SalesAmount] > 10000))
This calculates sales from transactions greater than โน10,000.
Use FILTER() when the filtering logic is more complex than a simple column = value condition.
๐น 7. Context Transition
This sounds complicated, but the basic idea is simple.
DAX has two important contexts:
๐ Row Context
Works with the current row.
๐ Filter Context
Determines which data is included in a calculation.
CALCULATE() has a special behavior:
It can convert row context into filter context.
This is called:
Context Transition
You will encounter this especially when using CALCULATE() inside calculated columns or iterator functions such as SUMX(), FILTER(), etc.
๐ก A simple way to remember CALCULATE():
CALCULATE() = "Calculate this measure, but under these filter conditions."
For example:
[Total Sales]
โ
CALCULATE(
[Total Sales],
Region = "West"
)
โ
"Calculate Total Sales, but only for West."
POWER BI LEVEL 5 โ DAX: CALCULATE(), FILTERS & CONTEXT
If you understand CALCULATE(), DAX becomes much easier.
The most important idea:
๐ CALCULATE() changes the filter context in which a measure is evaluated.
Example:
Total Sales =
SUM(Sales)[SalesAmount]
Now suppose you want sales only for the West region:
West Sales = CALCULATE( [Total Sales], Sales[Region] = "West" )
CALCULATE() takes the existing calculation and applies an additional filter.
๐น 1. CALCULATE() with multiple filters
You can apply multiple conditions:
West Electronics Sales = CALCULATE( [Total Sales], Sales[Region] = "West", Sales[Category] = "Electronics" )
This calculates sales where:
Region = West
AND
Category = Electronics
๐น 2. REMOVEFILTERS()
Sometimes you don't want a slicer or visual filter to affect your calculation.
Example:
Total Sales All Regions = CALCULATE( [Total Sales], REMOVEFILTERS(Sales[Region]) )
If a report is filtered to:
Region โ West
this measure still shows sales across all regions.
๐น 3. ALL()
ALL() can also remove filters.
Example:
Total Sales All Regions = CALCULATE( [Total Sales], ALL(Sales[Region]) )
A common use is calculating percentage of total.
Sales % of Total = DIVIDE( [Total Sales], CALCULATE( [Total Sales], ALL(Sales[Region]) ) )
If West has โน20 lakh sales and all regions have โน100 lakh:
Sales % of Total = 20%
๐น 4. ALLSELECTED()
ALLSELECTED() is useful when you want to respect the user's overall selections but ignore a visual-level grouping.
Example:
Sales % of Selected Regions = DIVIDE( [Total Sales], CALCULATE( [Total Sales], ALLSELECTED(Sales[Region]) ) )
If the user selects:
West + South
the calculation can compare each region against the total of the selected regions rather than the entire dataset.
๐น 5. KEEPFILTERS()
By default, CALCULATE() can replace an existing filter on the same column.
KEEPFILTERS() tells DAX to preserve the existing filter and apply the new condition on top of it.
Example:
CALCULATE( [Total Sales], KEEPFILTERS(Sales[Category] = "Electronics") )
Think of it as:
Existing filters
+
New filter
instead of replacing the existing filter.
๐น 6. FILTER()
FILTER() creates a filtered table based on a condition.
Example:
High Value Sales = CALCULATE( [Total Sales], FILTER( Sales, Sales[SalesAmount] > 10000))
This calculates sales from transactions greater than โน10,000.
Use FILTER() when the filtering logic is more complex than a simple column = value condition.
๐น 7. Context Transition
This sounds complicated, but the basic idea is simple.
DAX has two important contexts:
๐ Row Context
Works with the current row.
๐ Filter Context
Determines which data is included in a calculation.
CALCULATE() has a special behavior:
It can convert row context into filter context.
This is called:
Context Transition
You will encounter this especially when using CALCULATE() inside calculated columns or iterator functions such as SUMX(), FILTER(), etc.
๐ก A simple way to remember CALCULATE():
CALCULATE() = "Calculate this measure, but under these filter conditions."
For example:
[Total Sales]
โ
CALCULATE(
[Total Sales],
Region = "West"
)
โ
"Calculate Total Sales, but only for West."
โค2
๐ฏ Interview Questions
1๏ธโฃ What does CALCULATE() do?
It evaluates an expression after modifying the filter context.
2๏ธโฃ What is the difference between ALL() and REMOVEFILTERS()?
Both can remove filters, but REMOVEFILTERS() clearly communicates that the intention is to remove filters.
3๏ธโฃ What is ALLSELECTED() used for?
It helps calculate results based on the user's selected context while ignoring certain visual-level filters.
4๏ธโฃ What is KEEPFILTERS()?
It preserves existing filters when applying additional filters.
5๏ธโฃ What is context transition?
The conversion of row context into filter context, typically triggered by CALCULATE().
๐งช PRACTICE
Create these measures:
Total Sales
West Sales
Total Sales All Regions
Sales % of Total
Sales % of Selected Regions
Then add:
โ Region slicer
โ Category slicer
โ Sales by Region chart
Change the slicers and observe how each measure behaves.
That observation is one of the best ways to understand DAX filter context.
๐ก Key lesson:
Don't memorize CALCULATE().
Understand what filters exist, which filters you want to change, and what result you expect.
Double Tap โค๏ธ For More
1๏ธโฃ What does CALCULATE() do?
It evaluates an expression after modifying the filter context.
2๏ธโฃ What is the difference between ALL() and REMOVEFILTERS()?
Both can remove filters, but REMOVEFILTERS() clearly communicates that the intention is to remove filters.
3๏ธโฃ What is ALLSELECTED() used for?
It helps calculate results based on the user's selected context while ignoring certain visual-level filters.
4๏ธโฃ What is KEEPFILTERS()?
It preserves existing filters when applying additional filters.
5๏ธโฃ What is context transition?
The conversion of row context into filter context, typically triggered by CALCULATE().
๐งช PRACTICE
Create these measures:
Total Sales
West Sales
Total Sales All Regions
Sales % of Total
Sales % of Selected Regions
Then add:
โ Region slicer
โ Category slicer
โ Sales by Region chart
Change the slicers and observe how each measure behaves.
That observation is one of the best ways to understand DAX filter context.
๐ก Key lesson:
Don't memorize CALCULATE().
Understand what filters exist, which filters you want to change, and what result you expect.
Double Tap โค๏ธ For More
โค9
๐๐ป๐ณ๐ผ๐๐๐ ๐ ๐ผ๐๐ ๐๐๐ธ๐ฒ๐ฑ ๐๐ป๐๐ฒ๐ฟ๐๐ถ๐ฒ๐ ๐ค๐๐ฒ๐๐๐ถ๐ผ๐ป๐ & ๐๐ป๐๐๐ฒ๐ฟ๐๐
โ
โ Real Interview Experiences
โ Company-specific Handbook
โ Interview Process & Preparation Roadmap
โ FREE Preparation Resources
โ
Specialist Programmer :- https://pdlink.in/4xDH2lD
โ
โ Systems Engineer :- https://pdlink.in/4xAhGoL
โ
โInfosys Digital Specialist Engineer :- https://pdlink.in/4yJ98gb
โ
โThe best way to prepare is to learn from candidates who've already been through the process.
โ
โ
โ Real Interview Experiences
โ Company-specific Handbook
โ Interview Process & Preparation Roadmap
โ FREE Preparation Resources
โ
Specialist Programmer :- https://pdlink.in/4xDH2lD
โ
โ Systems Engineer :- https://pdlink.in/4xAhGoL
โ
โInfosys Digital Specialist Engineer :- https://pdlink.in/4yJ98gb
โ
โThe best way to prepare is to learn from candidates who've already been through the process.
โ
โค7
๐ Data Analyst Roadmap โ Part 27
POWER BI LEVEL 6 โ DAX TIME INTELLIGENCE
Time-based analysis is one of the most important things you will do in Power BI.
Businesses commonly ask:
๐ How much did sales grow this month?
๐ How does this year compare with last year?
๐ What was the sales total year-to-date?
๐ Which month had the highest sales?
๐ Are we growing or declining over time?
DAX Time Intelligence helps answer these questions.
๐น 1. You need a proper Date Table
Before using time-intelligence functions, create a dedicated Date table.
Example:
Date =
CALENDAR(
DATE(2024,1,1),
DATE(2026,12,31)
)
Then create useful columns:
โข Year
โข Month
โข Month Number
โข Quarter
โข Year-Month
Sort Month by Month Number so that January โ February โ March โ... โ December instead of alphabetical ordering.
Mark the table as a Date table in Power BI.
๐น 2. Total Sales
Start with a basic measure:
Total Sales =
SUM(Sales[SalesAmount])
This becomes the foundation for most time-based calculations.
๐น 3. Year-to-Date โ TOTALYTD()
YTD means Year To Date. It calculates the cumulative value from the beginning of the year up to the current date.
Example:
Sales YTD =
TOTALYTD(
[Total Sales],
'Date'[Date]
)
If the current month is June, the measure calculates: January + February + March + April + May + June
๐น 4. Previous Year Sales
To compare the current period with the same period last year:
Sales LY =
CALCULATE(
[Total Sales],
SAMEPERIODLASTYEAR('Date'[Date])
)
If the current visual shows March 2026, this measure returns March 2025 sales.
๐น 5. Year-over-Year Growth
Now compare current sales with last year:
YoY Growth =
[Total Sales] - [Sales LY]
YoY Growth % =
DIVIDE(
[Total Sales] - [Sales LY],
[Sales LY]
)
Example:
โข Current Year Sales = โน120 lakh
โข Previous Year Sales = โน100 lakh
โข Growth = โน20 lakh
โข Growth % = 20%
๐น 6. DATEADD()
DATEADD() shifts the current date context.
Previous Month Sales:
Sales Previous Month =
CALCULATE(
[Total Sales],
DATEADD(
'Date'[Date],
-1,
MONTH
)
)
Previous Year:
Sales Previous Year =
CALCULATE(
[Total Sales],
DATEADD(
'Date'[Date],
-1,
YEAR
)
)
You can shift by:
โข DAY
โข MONTH
โข QUARTER
โข YEAR
๐น 7. Month-over-Month Growth
First calculate previous month sales:
Sales PM =
CALCULATE(
[Total Sales],
DATEADD(
'Date'[Date],
-1,
MONTH
)
)
MoM Growth % =
DIVIDE(
[Total Sales] - [Sales PM],
[Sales PM]
)
Example:
โข January = โน10 lakh
โข February = โน12 lakh
โข MoM Growth = 20%
๐น 8. TOTALMTD() and TOTALQTD()
Similar to TOTALYTD():
MTD = Month To Date
Sales MTD =
TOTALMTD(
[Total Sales],
'Date'[Date]
)
QTD = Quarter To Date
Sales QTD =
TOTALQTD(
[Total Sales],
'Date'[Date]
)
So you can analyze:
โข MTD โ current month progress
โข QTD โ current quarter progress
โข YTD โ current year progress
๐น 9. Why Date Tables Matter
Suppose your sales table contains Order Date, Customer, Product, Sales. You could try to perform time calculations directly on Order Date, but a dedicated Date table gives you a consistent calendar for:
โข โ Year
โข โ Quarter
โข โ Month
โข โ Week
โข โ YTD
โข โ MTD
โข โ QTD
โข โ Previous period
โข โ YoY
โข โ MoM
This becomes especially important when working with multiple fact tables.
๐น 10. A Common Mistake
Don't create every time calculation as a calculated column.
Avoid creating separate columns for:
โข Previous Year Sales
โข YTD Sales
โข MoM Growth
โข YoY Growth
These are generally better as measures because they need to respond dynamically to filters and report context.
๐ฏ Interview Questions
1๏ธโฃ What is Time Intelligence in Power BI?
It is the use of DAX functions to perform calculations across dates and periods.
2๏ธโฃ Why do we need a Date table?
It provides a consistent calendar structure for reliable time-based analysis.
3๏ธโฃ What does SAMEPERIODLASTYEAR() do?
It returns the corresponding period from the previous year.
4๏ธโฃ What is the difference between MTD, QTD and YTD?
โข MTD = Month To Date
โข QTD = Quarter To Date
โข YTD = Year To Date
5๏ธโฃ What does DATEADD() do?
It shifts the current date context by a specified number of days, months, quarters, or years.
Double Tap โค๏ธ For More
POWER BI LEVEL 6 โ DAX TIME INTELLIGENCE
Time-based analysis is one of the most important things you will do in Power BI.
Businesses commonly ask:
๐ How much did sales grow this month?
๐ How does this year compare with last year?
๐ What was the sales total year-to-date?
๐ Which month had the highest sales?
๐ Are we growing or declining over time?
DAX Time Intelligence helps answer these questions.
๐น 1. You need a proper Date Table
Before using time-intelligence functions, create a dedicated Date table.
Example:
Date =
CALENDAR(
DATE(2024,1,1),
DATE(2026,12,31)
)
Then create useful columns:
โข Year
โข Month
โข Month Number
โข Quarter
โข Year-Month
Sort Month by Month Number so that January โ February โ March โ... โ December instead of alphabetical ordering.
Mark the table as a Date table in Power BI.
๐น 2. Total Sales
Start with a basic measure:
Total Sales =
SUM(Sales[SalesAmount])
This becomes the foundation for most time-based calculations.
๐น 3. Year-to-Date โ TOTALYTD()
YTD means Year To Date. It calculates the cumulative value from the beginning of the year up to the current date.
Example:
Sales YTD =
TOTALYTD(
[Total Sales],
'Date'[Date]
)
If the current month is June, the measure calculates: January + February + March + April + May + June
๐น 4. Previous Year Sales
To compare the current period with the same period last year:
Sales LY =
CALCULATE(
[Total Sales],
SAMEPERIODLASTYEAR('Date'[Date])
)
If the current visual shows March 2026, this measure returns March 2025 sales.
๐น 5. Year-over-Year Growth
Now compare current sales with last year:
YoY Growth =
[Total Sales] - [Sales LY]
YoY Growth % =
DIVIDE(
[Total Sales] - [Sales LY],
[Sales LY]
)
Example:
โข Current Year Sales = โน120 lakh
โข Previous Year Sales = โน100 lakh
โข Growth = โน20 lakh
โข Growth % = 20%
๐น 6. DATEADD()
DATEADD() shifts the current date context.
Previous Month Sales:
Sales Previous Month =
CALCULATE(
[Total Sales],
DATEADD(
'Date'[Date],
-1,
MONTH
)
)
Previous Year:
Sales Previous Year =
CALCULATE(
[Total Sales],
DATEADD(
'Date'[Date],
-1,
YEAR
)
)
You can shift by:
โข DAY
โข MONTH
โข QUARTER
โข YEAR
๐น 7. Month-over-Month Growth
First calculate previous month sales:
Sales PM =
CALCULATE(
[Total Sales],
DATEADD(
'Date'[Date],
-1,
MONTH
)
)
MoM Growth % =
DIVIDE(
[Total Sales] - [Sales PM],
[Sales PM]
)
Example:
โข January = โน10 lakh
โข February = โน12 lakh
โข MoM Growth = 20%
๐น 8. TOTALMTD() and TOTALQTD()
Similar to TOTALYTD():
MTD = Month To Date
Sales MTD =
TOTALMTD(
[Total Sales],
'Date'[Date]
)
QTD = Quarter To Date
Sales QTD =
TOTALQTD(
[Total Sales],
'Date'[Date]
)
So you can analyze:
โข MTD โ current month progress
โข QTD โ current quarter progress
โข YTD โ current year progress
๐น 9. Why Date Tables Matter
Suppose your sales table contains Order Date, Customer, Product, Sales. You could try to perform time calculations directly on Order Date, but a dedicated Date table gives you a consistent calendar for:
โข โ Year
โข โ Quarter
โข โ Month
โข โ Week
โข โ YTD
โข โ MTD
โข โ QTD
โข โ Previous period
โข โ YoY
โข โ MoM
This becomes especially important when working with multiple fact tables.
๐น 10. A Common Mistake
Don't create every time calculation as a calculated column.
Avoid creating separate columns for:
โข Previous Year Sales
โข YTD Sales
โข MoM Growth
โข YoY Growth
These are generally better as measures because they need to respond dynamically to filters and report context.
๐ฏ Interview Questions
1๏ธโฃ What is Time Intelligence in Power BI?
It is the use of DAX functions to perform calculations across dates and periods.
2๏ธโฃ Why do we need a Date table?
It provides a consistent calendar structure for reliable time-based analysis.
3๏ธโฃ What does SAMEPERIODLASTYEAR() do?
It returns the corresponding period from the previous year.
4๏ธโฃ What is the difference between MTD, QTD and YTD?
โข MTD = Month To Date
โข QTD = Quarter To Date
โข YTD = Year To Date
5๏ธโฃ What does DATEADD() do?
It shifts the current date context by a specified number of days, months, quarters, or years.
Double Tap โค๏ธ For More
โค6๐1
This media is not supported in your browser
VIEW IN TELEGRAM
๐ค New Powerful AI Model: GigaChat 3.5 Reasoning
This open-source LLM actually thinks before it answers! Perfect for complex coding, math, and reasoning prompts.
โ Built on GigaChat 3.5 Ultra: explores multiple step-by-step reasoning paths
โ Automated verification reinforces correct answers, enabling self-correction
โ Autonomously decides when to call external tools or revise earlier steps
โ Highly efficient: Linear attention uses 37% fewer tokens than DeepSeek V4 Flash Preview
๐ Massive benchmark gains over non-reasoning versions:
โข IFBench: 44 โ 77
โข Natural Plan: 64 โ 80
โข LiveCodeBench v6: 56 โ 85
๐ Open-sourced under MIT license. Weights on Hugging Face: fp8 | bf16
This open-source LLM actually thinks before it answers! Perfect for complex coding, math, and reasoning prompts.
โ Built on GigaChat 3.5 Ultra: explores multiple step-by-step reasoning paths
โ Automated verification reinforces correct answers, enabling self-correction
โ Autonomously decides when to call external tools or revise earlier steps
โ Highly efficient: Linear attention uses 37% fewer tokens than DeepSeek V4 Flash Preview
๐ Massive benchmark gains over non-reasoning versions:
โข IFBench: 44 โ 77
โข Natural Plan: 64 โ 80
โข LiveCodeBench v6: 56 โ 85
๐ Open-sourced under MIT license. Weights on Hugging Face: fp8 | bf16
โค5