>> Download the sample (Power BI)
This sample shows:
(i) The number of customers who bought one particular product
(ii) The number of customers who bought one particular product and also bought another type of product
(iii) As a percentage, the number of customers who bought one particular product and also bought another type of product
Dashboard - Snippet
Section titled “Dashboard - Snippet”
Data Model - Snippet
Section titled “Data Model - Snippet”
Measures - Cohort
Section titled “Measures - Cohort”No. of Customers who bought a Product
Section titled “No. of Customers who bought a Product”No. of Customers who bought a Product =IF ( [Same Product Selected], BLANK (), DISTINCTCOUNT ( Sales_Table[Customer] ))No. of Customers who bought both Products
Section titled “No. of Customers who bought both Products”No. of Customers who bought both Products =VAR MultiPurchaseEvaluation = CALCULATETABLE ( VALUES ( Sales_Table[Customer] ), ALL ( Products_Table ), USERELATIONSHIP ( Sales_Table[Product], 'Filter Products'[Products] ) )RETURN IF ( [Same Product Selected] = TRUE, BLANK (), CALCULATE ( [No. of Customers who bought a Product], MultiPurchaseEvaluation ) )No. of Customers who bought both Products as a %
Section titled “No. of Customers who bought both Products as a %”No. of Customers who bought both Products as a % =DIVIDE ( [No. of Customers who bought both Products], [No. of Customers who bought a Product], 0)Same Product Selected
Section titled “Same Product Selected”Same Product Selected =IF ( SELECTEDVALUE ( 'Filter Products'[Products] ) <> SELECTEDVALUE ( Sales_Table[Product] ), BLANK (), TRUE)Tables
Section titled “Tables”Calendar_Table
Section titled “Calendar_Table”Calendar_Table =GENERATE ( CALENDAR ( DATE ( 2017, 1, 1 ), DATE ( 2019, 12, 31 ) ), VAR currentDay = [Date] VAR Day = DAY ( currentDay ) VAR Month = MONTH ( currentDay ) VAR Year = YEAR ( currentDay ) RETURN ROW ( "Day", day, "Month", month, "Year", year ))