March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
06-07-2024 22:32 PM - last edited 06-18-2024 06:50 AM
I was assigned to analyze a sales report and conduct a basket analysis for inventory management to discontinue some products. This experience transformed how I think about data and my approach to problem-solving.
Learn
Useful Resource
Selection Customers =
CALCULATE ([Unique Customers],
TREATAS(VALUES('SelectedItem'[ITEM]), 'Sales Line'[Item]))
Basket Analysis =
VAR v1 = SELECTEDVALUE('SelectedItem'[ITEM])
VAR v2 = SELECTEDVALUE('GeneralBasket'[ITEM])
VAR V3 = SELECTEDVALUE('AnalysisType'[Type])
VAR v4 =
SUMMARIZE(FILTER('Sales Line',
RELATED('Sales Line -Duplicate'[Item]) = v1),'Sales Line'[Order #])
VAR v5 = SUMMARIZE(v4,
'Sales Line'[Order #],
"Basket" , CONCATENATEX(RELATEDTABLE('Sales Line'), 'Sales Line'[Item], "|")
)
VAR v6 = SUMX(v4,1)
VAR v7 = SUMX( v5, IF(PATHCONTAINS([Basket], v2),1, BLANK()))
RETURN
SWITCH(TRUE(),
v1 <> v2 && V3 = "% Second Product is Purchased with First", DIVIDE( v7,v6, BLANK() ),
v1 <> v2 && V3 = "Count of Shared Baskets", v7,
v1 <> v2 && V3 = "count of first Product Purchase", v6,
BLANK () )
eyJrIjoiMDgyNDlkNjAtZGRjZS00NjE0LWEwZDktMTRkMWQwYWFjNTBiIiwidCI6IjNlMjFhMTFlLTc3MDctNDdmOC1iMzRhLTc5YTQ2YTQ0ZTk5MyIsImMiOjF9