Forum Discussion
Row context
Row Context - When you create a measure then it works at the grouped data level. Means calculation will happen at city wise, state wise, category wise, etc.
If I have formula sum(Table[A]) / Sum(Table[B]) , the will first sum up till that level and then divided.
Now if use a filter
if(Max(City[City]) = "Abc", [Measure1], [MeasureB]), Now from where City value will come here; one that is in the row of your visual. That is your row context. If not in a row; then selected value on-page. Else it this will get blank value.
Row context help in many calculations. time intelligence.
Color measure for conditional formatting
Color Date = if(FIRSTNONBLANK('Date'[Date],TODAY()) <today(),"lightgreen","red")
refer: https://www.sqlbi.com/articles/row-context-and-filter-context-in-dax/
Earlier - Very High level is that it provides another copy to create lookup. We have partitioned data to get value.
example
First Sales = minx(filter(Sales, Sales[Customer Id]=EARLIER(Sales[Customer Id]) ),Sales[Sales Date])
Last Sales = maxx(FILTER(Sales,[Customer Id]=EARLIER(Sales[Customer Id]) && Sales[Sales Date] >EARLIER(Sales[Sales Date])),[Sales Date])
Refer: https://www.red-gate.com/simple-talk/sql/bi/cracking-dax-the-earlier-and-rankx-functions/