Daily DAX : Day 368 INDEX

📊Power BI DAX INDEX() Function

Syntax

INDEX(table, row_position [, column])

What It Does

INDEX() returns a single value from a specific position in a table.

  • Row Position: Which row (1 = first row)
  • Column: Optional - which column name

Parameters Table

ParameterTypeRequired?Description
tableTableYesYour data table
row_positionNumberYesRow number (1, 2, 3...)
columnColumn NameNoSpecific column (defaults to first column)

Simple Examples

1. Get 1st Row, 1st Column

INDEX(Sales, 1)

Returns: First sale amount

2. Get 3rd Row, "Product" Column

INDEX(Sales, 3, "Product")

Returns: Product name from row 3

Top 3 Use Cases

🎯 1. Dynamic Top N Values

Goal: Show Top 3 Customers

Total Sales = INDEX(Sales[Amount], RANKX(Sales, Sales[Amount]))

📈 2. Previous Month Value

Goal: Compare to last month

Previous Month = INDEX(MonthlySales[Revenue], MONTH(TODAY()) - 1)

🏆 3. Winner/Rank Display

Goal: Show #1 Sales Rep

Top Rep = INDEX(SalesReps[Name], 1, "Sales")

Quick Tips

Do This ✅Don't Do This ❌
Use with RANKX()INDEX(999999)
Small, specific tablesLarge tables (slow!)
Combine with FILTER()Forget row limits

Pro Tip

Always check: Does your table have enough rows? Use COUNTROWS() first!

Comments

Popular posts from this blog

Daily DAX : Day 65 INFO.TABLEPERMISSIONS

Daily DAX : Day 55 PV