
Explore Power BI fundamentals for data analysis and dashboard creation, including data preparation, modeling, and analytics, and learn how to download and install Power BI.
Learn to connect Power BI to an Excel dataset (Sample Superstore), load multiple sheets, recognize dimensions and measures, and create relationships to analyze region-wise sales and returns.
Connect and analyze multiple tables in Power BI by building relationships in the Northwind csv dataset, load data, clean encoding, and create calculated columns and measures for total sales.
Learn to connect and analyze a JSON stock data file in Power BI, loading AAPL data with date, open, high, low, close, and volume for line chart visualizations.
Create a Power BI dashboard from the sample superstore dataset, building visuals like pie chart, column chart, and map charts to show profit, sales, and quantity with interactive filtering.
Power BI course: build a simple hr analytics dashboard from hr analytics data. Create donut, pie, stacked and clustered bar charts, plus multi-row cards to display employee metrics.
Explore Power BI basics by loading populations.csv and visualizing country population growth from 1960 to 2021 with a line chart and a map chart, using filters, legend, and geocoding.
Build a simple financial dashboard in Power BI from an Excel data source, using filters and slicers for country and product, with cards and bar visuals for sales and profit.
Forecast sales and profit in Power BI using a financial data set, creating line charts, date-based axes, and forecast visuals with confidence intervals.
Learn to build a beginner-friendly e-commerce orders dashboard in Power BI, combining CSV data, modeling relationships, and creating KPIs, slicers, and maps for sales and profit insights.
Master dax queries in Power BI to create measures and columns from csv data, explore the northwind dataset, and format visuals for actionable insights.
Learn how row context and filter context drive DAX calculations in Power BI, with calculated columns and measures, iterating functions like sumx and averagex, and using calculate to modify filters.
Examples Used in the Chapter :
Sales2020 = CALCULATE(SUM(Sales[TotalSales]), Sales[Year] = 2020)
Sales2020CategoryA = CALCULATE(
SUM(Sales[TotalSales]),
Sales[Year] = 2020,
Sales[ProductCategory] = "Category A"
)
TotalSalesAllYears = CALCULATE(SUM(Sales[TotalSales]), ALL(Sales[Year]))
HighValueSales = CALCULATE(
SUM(Sales[TotalSales]),
FILTER(Sales, Sales[TotalSales] > 1000)
)
TotalSalesSum = SUM(Sales[TotalSales])
TotalRevenue = SUMX(Sales, Sales[Quantity] * Sales[UnitPrice])
Summary
SUM: Adds up all the values in a single column. Use it when you need a simple aggregation of values in one column.
Example: SUM(Sales[TotalSales])
SUMX: Performs row-by-row calculations using an expression and then sums the results. Use it for more complex scenarios where you need to compute values for each row before aggregating.
Example: SUMX(Sales, Sales[Quantity] * Sales[UnitPrice])
In DAX, the SAMEPERIODLASTYEAR function is used to compare values from the same period in the previous year. This is particularly useful for year-over-year (YoY) analysis, allowing you to compare, for instance, the sales of May 2024 with the sales of May 2023.
DateTable = CALENDAR(DATE(2023, 1, 1), DATE(2024, 12, 31))
Explore Power BI DAX techniques for time-based comparisons, including previous month sales and previous year sales. Create a dynamic date table, build measures, and establish relationships to calculate these values.
In Power BI, the RELATED function in DAX (Data Analysis Expressions) is used to fetch a related value from another table. It works within a row context to retrieve a corresponding value from a related table, which is linked through a relationship.
Here’s a basic explanation and example of how the RELATED function works:
Syntax
dax
RELATED(<column>)
<column>: The column from the related table that you want to retrieve.
How It Works
Relationships: RELATED relies on existing relationships between tables in your data model. There must be a relationship between the table you are working in and the table from which you want to retrieve the data.
Row Context: RELATED operates in a row context, meaning it evaluates on a row-by-row basis within the table where it is used.
Example Scenario
Imagine you have two tables:
Sales: Contains sales transaction data.
Columns: OrderID, ProductID, Quantity, SalesAmount
Products: Contains product details.
Columns: ProductID, ProductName, Category, Price
You want to add a calculated column in the Sales table to fetch the ProductName from the Products table.
Step-by-Step Example
Ensure Relationship: Ensure there is a relationship between the Sales table and the Products table on the ProductID column.
Create Calculated Column:
Go to the Sales table in Power BI.
Create a new calculated column using the following DAX formula:
dax
Product Name = RELATED(Products[ProductName])
Result: This new column, Product Name, will now contain the name of the product for each sales transaction, fetched from the Products table.
Practical Use Cases
Enhancing Data Models: Fetch additional details from related tables to enrich your data model.
Reporting: Include related data in reports without having to manually join tables.
Tips
Performance Considerations: Be mindful of performance when using RELATED extensively, especially with large datasets, as it can affect performance.
Alternative: For complex data models or performance optimization, consider using other DAX functions or data model designs, such as LOOKUPVALUE or combining tables in the query editor.
Common Pitfalls
Missing Relationships: If there’s no relationship between the tables, RELATED will not work.
Cardinality Issues: Ensure the relationship is appropriately set (e.g., one-to-many) for RELATED to function correctly.
By understanding and effectively using the RELATED function, you can leverage Power BI’s capabilities to create more insightful and connected data visualizations.
Step-by-Step Example
Create Measure: Go to the Sales table and create a new measure with the following DAX formula:
Average Sales Amount =
IF(
HASONEVALUE(Sales[ProductID]),
AVERAGE(Sales[SalesAmount]),
"Please select a single product"
)
Result:
If a single product is selected, the measure returns the average sales amount for that product.
If multiple products are selected, the measure returns the text “Please select a single product”.
Detailed Example
Let’s say we have a table Products with columns ProductID and ProductName. You want to display the total sales amount only if a single product is selected. Otherwise, you want to display a warning message.
Create Measure:
Total Sales Amount =
IF(
HASONEVALUE(Products[ProductName]),
SUM(Sales[SalesAmount]),
"Please select a single product"
)
Use in Visual: Add this measure to a card visual in Power BI.
When a single product is selected, the card will display the total sales amount for that product.
When multiple products are selected or no product is selected, the card will display the warning message.
Practical Tips
Combine with Other Functions: HASONEVALUE can be combined with other DAX functions like IF, VALUES, and SELECTEDVALUE for more complex logic.
Debugging: Use HASONEVALUE to debug and ensure the correct context is being applied in complex calculations.
Additional Example
Suppose you want to create a dynamic measure that shows the sales amount for a selected category. If multiple categories are selected, it should show a different message.
Category Sales Amount =
IF(
HASONEVALUE(Categories[CategoryName]),
SUM(Sales[SalesAmount]),
"Multiple categories selected"
)
Power BI DAX introduces all and all except to remove or modify filters in measures and calculated columns, resetting filter context across tables or columns.
Learn how the treatas function in DAX Power BI enables cross-table calculations without relationships by filtering sales data through a calculated table that maps category to sales.
Learn to use the lookup value function in DAX Power BI to return a value based on conditions, and create a calculated column to fetch product category by product ID.
Examples :
Approximate Customer Count = APPROXIMATEDISTINCTCOUNT('Sales'[Customer ID])
Approximate Product Count = APPROXIMATEDISTINCTCOUNT('Sales'[Product ID])
Approximate Customer Count (East) = CALCULATE( APPROXIMATEDISTINCTCOUNT('Sales'[Customer ID]), 'Sales'[Region] = "East" )
Average Sales = AVERAGE('Sales'[Sales])
Now, assume the Discount column has the following data:
| Discount |
|———-|
| 10 |
| 20 |
| TRUE |
| FALSE |
| | (blank)
| 30 |
To calculate the average discount using AVERAGEA:
Average Discount =
AVERAGEA('Sales'[Discount])
Explore count, countax, and countx in DAX for Power BI to count rows and evaluate expressions across a table, using non blank numeric values and discounts.
Discover how max, maxa, and maxx in DAX find the largest values in Power BI. Learn how blanks, text, and row-wise expressions are handled in each function with practical examples.
Discover essential date and time functions in DAX for Power BI, including today, date difference, end of month, year, month, format, and now, with practical column and measure examples.
Explore how dax filter functions in Power BI extract targeted data subsets with the filter function, including creating calculated tables and applying multi-condition filters.
Master keep filters and remove filters in DAX to control regional filters in Power BI visuals, and calculate total sales excluding or including region constraints.
Use the distinct function in Power BI to return a one-column table of unique values, such as distinct city names, and create a new table in modeling to store them.
Learn how the is filtered function in DAX checks if a column is filtered and use IF to return sum of sales when true, or blank when false.
Explore essential DAX financial functions—PMT, FV, PV, NPV, XNPV, and XIRR—to model loans, investments, interest, and cash flows with sample data in Power BI.
Explore Power Query Editor in Power BI by transforming the Northwind OData feed, applying group by to count customers by country, and preparing data for visuals.
Rename operations in power query editor guide you to rename data sources, columns, and queries, with practical examples using the Northwind csv dataset and applying steps in query settings.
Learn how to change column data types in Power Query Editor for Power BI, including whole numbers, decimals, and dates. Load a csv and replace conversions.
Merge two columns in Power Query Editor for Power BI using the Merge Column tab with a chosen separator to create a new column named product info.
Split columns in Power Query in Power BI to create new columns using delimiters such as @, space, or comma, choosing leftmost, rightmost, or every delimiter; rename results as needed.
Apply pivot operations in Power Query Editor within Power BI on the Titanic dataset to summarize survival by class and gender, creating alive and died counts from the survived column.
Learn to append queries in Power Query Editor for Power BI to combine data from multiple sheets or sources and create total and half-year sales.
Publish your Power BI desktop report to the Power BI service by signing up for a pro or premium per user license, then publish to a workspace online.
Power BI Tutorial for Beginners - Master Data Visualization and Business Intelligence!
Unlock the power of your data with Power BI, one of the most sought-after business intelligence tools in the world. This beginner-friendly course is designed to help you quickly learn how to transform raw data into actionable insights using stunning dashboards and reports.
What You’ll Learn:
Getting Started: Navigate Power BI’s interface, install, and set up the software.
Data Connections: Import data from Excel, databases, and online sources.
Data Transformation: Clean and prepare your data using Power Query.
Visualization Basics: Create interactive charts, graphs, and tables.
Dashboard Creation: Design professional-looking dashboards for decision-making.
Data Modeling: Understand relationships between datasets for more advanced reporting.
Sharing Insights: Publish and share reports.
Key Features:
Step-by-step video tutorials.
Real-world datasets for hands-on practice.
Lifetime access to course materials.
Who This Course is For:
Beginners with no prior experience in Power BI or data visualization.
Business professionals, analysts, and students seeking to enhance their data skills.
Anyone looking to make data-driven decisions effectively.
By the end of this course, you’ll have the confidence to create compelling reports and dashboards, turning complex data into clear, actionable insights.
Enroll now and take your first step toward becoming a Power BI pro!