0
0
Power BIbi_tool~10 mins

Variables (VAR/RETURN) in Power BI - Cell-by-Cell Formula Trace

Choose your learning style9 modes available
Sample Data

Sales data for three products: Apples, Bananas, and Cherries with their sales amounts.

CellValue
A1Product
B1Sales
A2Apples
B2100
A3Bananas
B3150
A4Cherries
B4200
Formula Trace
VAR TotalSales = SUM(Sales[Sales]) RETURN TotalSales * 0.1
Step 1: SUM(Sales[Sales])
Step 2: VAR TotalSales = 450
Step 3: RETURN TotalSales * 0.1
Cell Reference Map
   A        B
1 Product  Sales
2 Apples   100
3 Bananas  150
4 Cherries 200

[Formula references Sales column B2:B4]
The formula uses the Sales column (cells B2 to B4) to calculate the total sales.
Result
   A        B        C
1 Product  Sales    Result
2 Apples   100      45
3 Bananas  150
4 Cherries 200

Result cell C2 shows 10% of total sales (45).
The result 45 is shown as 10% of the total sales in the result column.
Sheet Trace Quiz - 3 Questions
Test your understanding
What does the variable TotalSales store?
AThe average sales amount
BThe sum of all sales amounts
CThe highest sales amount
DThe number of products
Key Result
Use VAR to store intermediate results and RETURN to output the final calculation.