Learn DAX Fundamentals in 10 Minutes | Step-by-Step Guide
Introduction to DAX Fundamentals
Overview of the Video
- The video introduces the fundamentals of DAX (Data Analysis Expressions) in Power BI, covering 8 formulas ranging from simple to complex functions.
- A dataset related to a beverage distribution company is used for demonstration, including geographical and financial information.
Creating Basic Measures
- The first measure created is "Total Revenue," calculated using the SUM function on the revenue column.
- To visualize this measure, it must be added to a Matrix visual in Power BI after creation.
Unique Brands Calculation
- The second measure, "Unique Brands," uses the DISTINCTCOUNT function to count unique beverage brands sold.
- Comments can be added within DAX formulas by using Shift + Enter and typing comments prefixed with two dashes.
Advanced Calculations
Profit Calculation
- A new measure called "Profit" is created by subtracting total expenses from total revenue using SUM functions.
Profit Margin Calculation
- The profit margin is calculated as profit divided by revenue; however, the DIVIDE function is used to handle potential division by zero errors safely.
Transitioning from Measures to Calculated Columns
Understanding Calculated Columns
- The video explains that calculated columns evaluate each row individually rather than aggregating data like measures do.
Combining Data into New Columns
- A new calculated column named "Region and State" combines region and state data using an ampersand (&), ensuring proper spacing between values.
Categorizing Shipments
Shipment Size Classification
- A new column categorizes shipments as "small" or "large" based on unit sales using an IF statement for logical testing.
Three-Tiered Shipment Categories
- An advanced IF statement creates three categories: small, medium (5000 - 10000 units), and large (over 10000 units).
Filtering Revenue Data
Specific Beverage Revenue Calculation
- A measure called "Sprite Revenue" calculates total revenue specifically for Sprite using the CALCULATE function with a filter condition.
Multiple Beverage Revenue Calculation
- The formula is modified to calculate revenue for both Sprite and Fanta by incorporating an OR condition within the filter.
Turn any video into a summary like this
YouTube links, meetings, lectures. With transcripts, search, and chat.