>> Download the sample (Power BI)
This sample shows total cumulative sales, from the best-selling product to the lowest-selling product.
Dashboard - Snippet
Section titled “Dashboard - Snippet”
Data Model - Snippet
Section titled “Data Model - Snippet”
Measures - Sales & Profit
Section titled “Measures - Sales & Profit”Cumulative Sales by Product, Ranked by Product Sales
Section titled “Cumulative Sales by Product, Ranked by Product Sales”Cumulative Sales by Product, Ranked by Product Sales =VAR IndexRank = 'Ranking Index'[Ranking Index Value]VAR CumTotal = SUMX ( FILTER ( SUMMARIZE ( Products_Table, Products_Table[Products], "Sales", [Total Sales], "Sales Ranking", RANKX ( ALL ( Products_Table ), [Total Sales],, DESC ) ), [Sales Ranking] <= IndexRank ), [Sales] )RETURN IF ( [Product Sales, Ranked by Product Sales] = BLANK (), BLANK (), CumTotal )Product Name Ranked by Sales
Section titled “Product Name Ranked by Sales”Product Name Ranked by Sales =CALCULATE ( SELECTEDVALUE ( Products_Table[Products], BLANK () ), FILTER ( VALUES ( Products_Table[Products] ), RANKX ( ALL ( Products_Table ), [Total Sales],, DESC ) = [Ranking Index Value] ))Product Sales, Ranked by Product Sales
Section titled “Product Sales, Ranked by Product Sales”Product Sales, Ranked by Product Sales =CALCULATE ( [Total Sales], FILTER ( VALUES ( Products_Table ), Products_Table[Products] = [Product Name Ranked by Sales] ))Total Sales
Section titled “Total Sales”Total Sales =SUMX ( Sales_Table, Sales_Table[Unit Price] * Sales_Table[Quantity] )Measures - Ranking Index
Section titled “Measures - Ranking Index”Ranking Index Value
Section titled “Ranking Index Value”Ranking Index Value =SELECTEDVALUE ( 'Ranking Index'[Ranking Index] )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 ))Ranking Index
Section titled “Ranking Index”Ranking Index =GENERATESERIES ( 1, 200, 1 )