'SSRS: Get values from a particular row of DataSet?

My dataset currently has 12 rows of data. Each representing data for a month. I would like to have variance of a column between to rows, the rows being last & last but one i.e., latest month and previous month's data.
It could have been simple if I were to work on tablix but thats not the case. I want those values for a textbox.

Any ideas on it anyone?



Solution 1:[1]

In this example I have a tablix with Statecode and name as below enter image description here

Suppose you want to display the name of state of CA, write an expression as -

=Lookup(
   "CA" ,
   Fields!StateCode.Value,
   Fields!StateName.Value,
   "ReportData"
)

This will return 'California' in the text box

Solution 2:[2]

I ran across this post while trying to solve a similar problem but with columns of double data type. Not sure why but SSRS did not want to return my first row using LOOKUP in combination with ROW_NUMBER in SQL(If someone can solve that all the better). I ended up using a SUM(IIF) instead. Hopefully, this is useful for someone else.

 =Sum(IIF(Fields!RowNum.Value=1,CDBL(Fields!MyNumericColumn.Value),CDBL(0)))

Note: If SSRS complains about data types, just cast both parts of the IIF to the desired data type.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 ExceptionLimeCat