*****Key Measures********
- Total Sales = sum(sales[total revenue])
- Total Quantity = sum(sales[order quantity])
- Total Profit = calculate(sum(sales[total revenue])) -
calculate(sumx(sales, sales[order quantity]*
sales[total unit cost]))
- Profit % = DIVIDE([TOTAL PROFITS],[TOTAL SALES],0)
*****Time Comparison******
- sales LY =
if (
[total sales] <> blank(),
if (
HASONEVALUE('Date Table'[MonthName]),
calculate([total sales],SAMEPERIODLASTYEAR('Date Table'[Date])
),
CALCULATE([Total Sales], DATESBETWEEN('Date Table'[Date],EDATE(min('Date Table'[Date]),-12), EOMONTH(MAX(Sales[OrderDate]),-12)))))
- Sales 2yrs ago = calculate(sum(sales[total revenue]), DATEADD(dimdate[date],-2,year)) // you can do +2 as well
****Cumulative Measures*******
- Cumulative Sales =
if (
[total sales] <> blank(),
calculate ([total sales],
filter( allselected(dates),
dates[date] <= Max( dates[date]))))
- Cumulative Performance ly =
if (
[total sales] <> blank(),
CALCULATE([sales ly],
filter(allselected(Dates), dates[date] <= MAX (Dates[Date])))
)
*******Moving Averages********
- Profits 30D MA = averagex(dateinperiod(dates[date],lastdate(dates[date]),-30,day),
[total profit])
- Sales 30D MA = averagex(dateinperiod(dates[date],lastdate(dates[date]),-30,day),
[total sales])
- Transactions 30D MA
total days transacting = distinctcount(sales[order date])
or
total transaction = countrows (sales)
= averagex(dateinperiod(dates[date],lastdate(dates[date]),-30,day),
[total transaction])
transactions in last 30 days
var last_date = lastdate(sales[order date]) or last_date = today()
return
calculate ([total transaction],
filter ( all (dates),
dates[date] > last_date - 30 &&
dates[date] <= last_date ))