Ideas Bid - Dta Lab 5
Ideas Bid - Dta Lab 5
In today’s class, we will build a beautiful report from start to finish using DAX expressions and a
retail dataset.
First, let’s take a quick look at our dataset. Our financial sample dataset includes columns like:
1. Total Sales
o This measure calculates the sum of the Total Amount column, providing the
overall revenue.
o SUM: This function adds up all the values in a column.
o 'Sales'[Total Amount]: Specifies the column we are summing, which is the Total
Amount column in the Sales table.
o Knowing total sales is crucial for assessing the company’s revenue. Helps to
understand the revenue generated over different periods or by different categories.
2. Total Quantity Sold
o This measure sums up the Quantity column, giving the total number of items sold.
o SUM: This function adds up all the values in a column.
o 'Sales'[Quantity]: Specifies the column we are summing, which is the Quantity
column in the Sales table.
o Helps in tracking sales volume. Identifies best-selling products and trends in sales
volume.
3. Average Sales per Transaction
Average Sales per Transaction = AVERAGE ('Sales'[Total Amount])
Advanced Measures:
o This measure calculates total sales for each product category by removing all
filters except the Product Category.
o CALCULATE: This function changes the context in which the data is evaluated.
o SUM('Sales'[Total Amount]): Sums up all the values in the Total Amount
column.
o ALLEXCEPT('Sales', 'Sales'[Product Category]): Removes all filters except
for the Product Category column.
o Useful for understanding which categories contribute most to revenue. Identifies
high-revenue product categories.
2. Sales by Gender
o Explanation: This measure calculates the total sales amount for each customer.
o CALCULATE: This function changes the context in which the data is evaluated.
o SUM('Sales'[Total Amount]): Sums up all the values in the Total Amount
column.
o ALLEXCEPT('Sales', 'Sales'[Customer ID]): Removes all filters except for the
Customer ID column.
o Helps understand the value each customer brings over their lifetime.Identifies
high-value customers.
5. Profit Margin
o Since there is a Cost column in the dataset:
• This measure calculates the total sales amount for the same period in the previous year.
• CALCULATE: This function changes the context in which the data is evaluated.
• SUM('Sales'[Total Amount]): Sums up all the values in the Total Amount column.
• SAMEPERIODLASTYEAR('Sales'[Date]): Adjusts the date context to the same
period in the previous year.
• Essential for year-over-year comparison. Evaluates sales growth and trends over the same
period in the previous year.
o This measure calculates the total sales amount from the beginning of the year to
the current date.
o CALCULATE: This function changes the context in which the data is evaluated.
o SUM('Sales'[Total Amount]): Sums up all the values in the Total Amount
column.
o DATESYTD('Sales'[Date]): Shifts the date context to cover the period from the
start of the year to the current date.
o Important for tracking annual performance. Monitors cumulative sales
performance within the year.
3. Total Sales Month to Date (MTD)
o This measure calculates the total sales amount from the beginning of the month to
the current date.
o CALCULATE: This function changes the context in which the data is evaluated.
o SUM('Sales'[Total Amount]): Sums up all the values in the Total Amount
column.
o DATESMTD('Sales'[Date]): Shifts the date context to cover the period from the
start of the month to the current date.
o Useful for monthly performance analysis.Assesses sales progress within the
current month.
4. Total Sales Quarter to Date (QTD)
Total Sales QTD = CALCULATE(SUM('Sales'[Total Amount]),
DATESQTD('Sales'[Date]))
o This measure calculates the total sales amount from the beginning of the quarter
to the current date.
o CALCULATE: This function changes the context in which the data is evaluated.
o SUM('Sales'[Total Amount]): Sums up all the values in the Total Amount
column.
o DATESQTD('Sales'[Date]): Shifts the date context to cover the period from the
start of the quarter to the current date.
o Critical for quarterly performance evaluation.Tracks sales performance within the
current quarter.
Creating Visualizations
Now, let’s create some visualizations to bring our data to life. These visualizations will help us
understand our data better and make informed business decisions.