How DAX Sees Data: Row Context vs Filter Context

Row vs Filter Context — Power BI | analytics.bi

Row contextandFilter context– two cornerstone principles of DAX.

Why does the same formula sometimes show different results? You’ll find the answer below in this article.

If you’re just starting with DAX, it’s worth first understanding the basics:an introduction to DAX.

It’s also recommended to review:the full Power BI guide, where the whole process is explained from start to finish.

DAX formulas are not just mathematical operations – their result depends on context.

Row context ir filter context skirtumas Power BI

What Row context is

Row contextmeans that the calculation happens for each row separately.

Profit = Sales[Revenue] - Sales[Costs]

Row context is most often used in:

  • calculated columns
  • X functions (SUMX, COUNTX, etc.)

More on iterators:DAX X functions

What Filter context is

Filter contextdetermines which rows participate in the calculation.

Sales = SUM(Sales[Amount])

It comes from:

  • slicers
  • visuals
  • filters

More on managing filters:ALL, REMOVEFILTERS and KEEPFILTERS

The main difference

  • Row context– how to calculate
  • Filter context– what to calculate
Row context vs filter context palyginimas Power BI

This comparison helps you clearly understand the difference between these contexts.

Row context calculates at the row level, while filter context decides which rows enter the calculation.

How they work together

In practice they often work together.

Total profit = SUM(Sales[Profit])

CALCULATE and changing context

CALCULATElets you change the filter context.

Sales in Vilnius =
CALCULATE(
    SUM(Sales[Amount]),
    Sales[City] = "Vilnius"
)

More:the DAX CALCULATE function

Common mistakes

  • A calculated column is used instead of a measure
  • The context isn’t understood
  • CALCULATE is used incorrectly
The key points:
  • Row context = the row level
  • Filter context = the data selection
  • CALCULATE = changes the filters

What to read next

Conclusion

Row context and filter context are the foundation of all of DAX.

Once you understand these principles, Power BI calculations become clearer and predictable.

Free cheat sheet

Power Query cheat sheet: automate your report

The key steps, the 5 common mistakes, and when automating is worth it.

  • PDF · 2 pages, practical
  • No spam — value only
Blank Form (#5) (#6)
No spam. Unsubscribe anytime.

Similar Posts