>> Download the sample (Power BI)
This sample shows the Total Sales of only those customers who meet certain performance criteria in:
- Annual sales
- Number of annual transactions
- Annual profit margins
Dashboard - Snippet
Section titled “Dashboard - Snippet”
Data Model - Snippet
Section titled “Data Model - Snippet”
Measures - Sales & Customer
Section titled “Measures - Sales & Customer”Profit Margin
Section titled “Profit Margin”Profit Margin =DIVIDE([Total Profits], [Total Sales], 0)Total Costs
Section titled “Total Costs”Total Costs =SUMX ( Sales_Table, Sales_Table[Unit Cost] * Sales_Table[Quantity] )Total Profits
Section titled “Total Profits”Total Profits =[Total Sales] - [Total Costs]Total Sales
Section titled “Total Sales”Total Sales =SUMX ( Sales_Table, Sales_Table[Unit Price] * Sales_Table[Quantity] )Total Sales of only those Customers that meet criteria in (Annual Sales, No. of Annual Transactions, and Annual Profit Margins)
Section titled “Total Sales of only those Customers that meet criteria in (Annual Sales, No. of Annual Transactions, and Annual Profit Margins)”Total Sales of only those Customers that meet criteria in (Annual Sales, No. of Annual Transactions, and Annual Profit Margins) =VAR SalesThreshold = CALCULATE ( SELECTEDVALUE ( 'Customer Total Sales Threshold Criteria Groups'[Threshold] ), 'Customer Total Sales Threshold Criteria Groups'[Target Metric] = "Annual Sales" )VAR TransactionThreshold = CALCULATE ( SELECTEDVALUE ( 'Customer Total Sales Threshold Criteria Groups'[Threshold] ), 'Customer Total Sales Threshold Criteria Groups'[Target Metric] = "Annual Transactions" )VAR MarginThreshold = CALCULATE ( SELECTEDVALUE ( 'Customer Total Sales Threshold Criteria Groups'[Threshold] ), 'Customer Total Sales Threshold Criteria Groups'[Target Metric] = "Annual Margins" )RETURN CALCULATE ( [Total Sales], FILTER ( VALUES ( Customer_Table[Customer] ), COUNTROWS ( FILTER ( 'Customer Total Sales Threshold Criteria Groups', [Total Sales] >= SalesThreshold && [Total Transactions] >= TransactionThreshold && [Profit Margin] >= MarginThreshold ) ) > 0 ) )Total Transactions
Section titled “Total Transactions”Total Transactions =COUNTROWS ( Sales_Table )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 ))