__STYLES__
This Power BI report provides a sales analysis for our stakeholders, including a business summary, basket analysis and customer analysis to provide insights into our sales.
The business summary page in this report provides an overall summary of our sales, including:
Total Sales =
SUMX(Sales_Data,
Sales_Data[Order Quantity] * Sales_Data[Unit Price])
MoM Revenue Growth Rate =
VAR lastmonthSales = CALCULATE([Total Sales], DATEADD(Dates[Date], -1, MONTH))
RETURN
DIVIDE( [Total Sales]-lastmonthSales, lastmonthSales, 0)
Total Profits = [Total Sales] - [Total Cost]
Total Customers =
COUNTROWS(VALUES(Sales_Data[Customer Name Index]))
To return the value for the top 3 best selling cities, I used TOPN. This returns the value in sales for the top 3 cities, then I combined this with the cities fields to show the cities and their respective values.
Top 3 Best Selling Cities =
VAR Cities = VALUES(Regions_Table[City])
RETURN
CALCULATE( [Total Sales],
TOPN(3, ALL(Regions_Table[City]), [Total Sales],DESC),
Cities )
Total Quantity Sold = SUM(Sales_Data[Order Quantity])
Cumulative Sales =
CALCULATE( [Total Sales],
FILTER( ALLSELECTED( Dates),
Dates[Date] <= MAX(Dates[Date])))
For the cumulative sales LM, I used measure branching by first creating a measure for sales last month, then I applied the same logic as above for cumulative sales, swapping the 'Total Sales' for 'Sales Last Month'
Sales Last Month =
CALCULATE(
[Total Sales],
DATEADD(Dates[Date], -1, MONTH))
Cumulative Sales LM =
CALCULATE( [Sales Last Month],
FILTER( ALLSELECTED( Dates),
Dates[Date] <= MAX(Dates[Date])))
Again, for the cumulative sales 2 months ago, I used measure branching. First I created a measure for sales 2 months ago, then I used this measure in my calculate formula.
Sales 2 Months ago =
CALCULATE(
[Total Sales],
DATEADD(Dates[Date], -2, MONTH))
Cumulative Sales 2 Months ago =
CALCULATE( [Sales 2 Months ago],
FILTER( ALLSELECTED( Dates),
Dates[Date] <= MAX(Dates[Date])))
The basket analysis page in this report provides a deep dive into our customers' buying patterns e.g. cross selling, best/worst selling products and valuable insights such as average order value: -
Total Sales =
SUMX(Sales_Data,
Sales_Data[Order Quantity] * Sales_Data[Unit Price])
Total Transactions = COUNTROWS(Sales_Data)
Average Order Value (AOV) =
COALESCE(
DIVIDE( [Total Sales], [Total Transactions], 0)
,0)
Top 5 Products =
VAR Products = VALUES(Products_Data[Product Name])
RETURN
CALCULATE( [Total Sales],
TOPN(5, ALL(Products_Data[Product Name]), [Total Sales],DESC),
Products)
Worst 5 Products =
VAR Products = VALUES(Products_Data[Product Name])
RETURN
CALCULATE( [Total Sales],
TOPN(5, ALL(Products_Data[Product Name]), [Total Sales],ASC),
Products)
Customers Who Bought =
IF(
SELECTEDVALUE( Filter_Products_Data[Filter_Index]) = SELECTEDVALUE( Sales_Data[Product Description Index]),
BLANK(),
DISTINCTCOUNT(Sales_Data[Customer Name Index]))
Customers with Both Products =
VAR BothProducts =
CALCULATETABLE( VALUES( Sales_Data[Customer Name Index]),
ALL( Products_Data),
USERELATIONSHIP(Sales_Data[Product Description Index], Filter_Products_Data[Filter_Index]))
RETURN
CALCULATE( [Customers Who Bought], BothProducts)
Cross Selling % =
DIVIDE( [Customers with Both Products], [Customers Who Bought], 0 )
The customer analysis page in this report provides a thorough analysis of customer segmentation, this could be useful for targeting customers with discounts, rewards etc to maximise sales and keep customers returning. Useful insights include:
Total Customers =
COUNTROWS(VALUES(Sales_Data[Customer Name Index]))
Customers That Ordered Last Month and This Month (INTERSECT) =
COALESCE(
COUNTROWS(INTERSECT(
VALUES(Sales_Data[Customer Name Index]),
CALCULATETABLE( VALUES( Sales_Data[Customer Name Index]), DATEADD(Dates[Date], -1, MONTH)))),
0)
Customers That Didnt Order Last Month (Except) =
COALESCE(
COUNTROWS(EXCEPT(
VALUES(Sales_Data[Customer Name Index]),
CALCULATETABLE( VALUES( Sales_Data[Customer Name Index]), DATEADD(Dates[Date], -1, MONTH))))
,0)
New Customers =
VAR Customers = VALUES(Sales_Data[Customer Name Index])
RETURN
CALCULATE([Total Customers],
FILTER( Customers,
CALCULATE( COUNTROWS( Sales_Data),
FILTER( ALLSELECTED( Dates ), Dates[Date] < MIN( Dates[Date] ) ) ) = 0 ) )
Returning Customers = [Total Customers] - [New Customers]
New Customer Sales =
VAR Customers = VALUES(Sales_Data[Customer Name Index])
RETURN
CALCULATE([Total Sales],
FILTER( Customers,
CALCULATE( COUNTROWS( Sales_Data),
FILTER( ALLSELECTED( Dates ), Dates[Date] < MIN( Dates[Date] ) ) ) = 0 ) )
Returning Customer Sales = [Total Sales] - [New Customer Sales]