Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Jeanxyz
Power Participant
Power Participant

values() vs row context

Hi, 

 

I am trying to understand row context in values() formula. In the printscreen, I have created a calculated column using values(sales[product category]) as the interation context. 

 

I'm not sure how DAX calculates values(sales[ product category] (based on the whole sales table or based on the current row of column -product cateogry?). It looks the calculated column gives me the total sales per [product category] and per [sales amount]. Why does it work that way? 

 

Can someone explains step by step how the filter context is modified ?

 

nested row context.PNG

 

1 ACCEPTED SOLUTION

In this case, it's using the row context from the table argument values(sales). It iterates over each row in this table using the row context from this table.

 

When you write values(sales[product category]), this does not contain the [sales amount] and [retail margin] columns, so these cannot be from that row context and it instead interprets it as the original row context.

View solution in original post

3 REPLIES 3
AlexisOlson
Super User
Super User

When you're working with calculated columns there isn't any filter context unless CALCULATE is involved. So when you reference a column, it assumes that you are either referring to the value in the current row (row context) or referencing the entire column (it assumes this when you put a column name inside an aggregation function).

 

In your formula, values(sales[ product category]) is the list {"1A", "2A", "3A"} so it's iterating through the three items and adding the result of sales[sales amount*sales[retail margin] for each iteration, effectively multiplying it by three.

Thanks, Alexis. 

I'm still a bit confused with row context. There are actually two row contexts, the old row context comes from the calculated column, a new row context is created when a values() formula is created. Not sure which row context is used here. 

 

If I change the values() formula to the values(sales), it seems to iterate each row based on the row context (not sure if it's the new row context or old row context as they are the same) and sum up the total. In other words, it doesn't multiple by 

sales[sales amount]*sales[retail margin] by 13 times (i.e., there are 13 rows in the values(sales) table).
Why the new calculated column behaves differerntly?
 
row context2.PNG

In this case, it's using the row context from the table argument values(sales). It iterates over each row in this table using the row context from this table.

 

When you write values(sales[product category]), this does not contain the [sales amount] and [retail margin] columns, so these cannot be from that row context and it instead interprets it as the original row context.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors