>> Download the sample (Power BI)
This sample shows the revenue for each product as a % of total sales for all products.
Dashboard - Snippet
Section titled “Dashboard - Snippet”
Data Model - Snippet
Section titled “Data Model - Snippet”
Measures - Sales
Section titled “Measures - Sales”% of Total Revenue
Section titled “% of Total Revenue”% of Total Revenue =DIVIDE ( [SUMX Total Sales], CALCULATE ( [SUMX Total Sales], ALL ( Products_Table ) ), BLANK ())SUMX Total Sales
Section titled “SUMX Total Sales”SUMX Total Sales =SUMX ( Sales_Table, Sales_Table[Quantity] * Sales_Table[Unit Price] )Yearly Diff. % of Total Revenue
Section titled “Yearly Diff. % of Total Revenue”Yearly Diff. % of Total Revenue =IF ( CALCULATE ( [% of Total Revenue], DATEADD ( Calendar_Table[Date], -1, YEAR ) ) = 0, BLANK (), [% of Total Revenue] - CALCULATE ( [% of Total Revenue], DATEADD ( Calendar_Table[Date], -1, YEAR ) ))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 ))