Geek Logbook

Tech sea log book

Modes and Examples of KPIs in Data Analysis Expressions (DAX)

Last Year Comparison

When analyzing sales performance, it is often useful to compare the current year’s sales with the same period in the previous year. To do this, we create several calculated measures:

  • Total Sales: Calculates the total sales.
  • LY Sales: Calculates last year’s sales.
  • Sales Var: Calculates the sales variance between this year and last year.
  • Sales Var %: Calculates the percentage change in sales between this year and last year.

DAX expressions to calculate similar measures for Units instead of Revenue:

-- Total Units
Total Units = SUM(Sales[Units])

-- LY Total Units
LY Total Units = CALCULATE([Total Units], SAMEPERIODLASTYEAR('Date'[Date]))

-- Total Units Var
Total Units Var = [Total Units] - [LY Total Units]

-- Total Units Var %
Total Units Var % = DIVIDE([Total Units Var], [LY Total Units])

Year-to-Date (YTD) Comparison

Year-to-date (YTD) measures track performance from the beginning of the current year up to the present date. Comparing YTD sales with last year’s YTD sales provides valuable insights into sales trends.

  • YTD Sales: Calculates the YTD sales.
  • LY YTD Sales: Calculates last year’s YTD sales.
  • YTD Sales Var: Calculates the variance between this year’s and last year’s YTD sales.
  • YTD Sales Var %: Calculates the percentage variance between this year’s and last year’s YTD sales.

DAX expressions to calculate similar measures for Units instead of Revenue:

-- YTD Total Units
YTD Total Units = TOTALYTD([Total Units], 'Date'[Date])

-- LY YTD Total Units
LY YTD Total Units = CALCULATE([YTD Total Units], SAMEPERIODLASTYEAR('Date'[Date]))

-- YTD Total Units Var
YTD Total Units Var = [YTD Total Units] - [LY YTD Total Units]

-- YTD Total Units Var %
YTD Total Units Var % = DIVIDE([YTD Total Units Var], [LY YTD Total Units])

Market Share Analysis

Market share analysis helps determine the proportion of total sales that come from the company’s own manufactured products versus other companies’ products. The results can be expressed in both absolute numbers and percentages.

  • Total Company Sales: Calculates sales where the manufacturer is the company’s own brand.
  • % Sales Market Share: Calculates the percentage of sales from the company’s manufactured products relative to total sales.

DAX expressions to calculate similar measures for Units instead of Revenue:

-- Total Company Units
Total Company Units = CALCULATE([Total Units], Manufacturers[Manufacturer] = "YourName")

-- % Units Market Share
% Units Market Share = IF([Total Company Units] = 0, 0, DIVIDE([Total Company Units], [Total Units], 0))

By implementing these DAX expressions, you can gain meaningful insights into sales performance, market trends, and company competitiveness.

Tags: