Variance is defined as the difference between the actual cost and the standard cost, as described in the following formula.
actual cost  standard cost = variance
If the actual cost changes, for example, because you post an item charge on a later date, then the variance is updated accordingly.
Note 

Revaluation does not affect the variance calculation, because revaluation only changes the inventory value. 
Example
The following example illustrates how variance is calculated for purchased items. It is based on the following scenario:

The user purchases an item at LCY 90.00, but the standard cost is LCY 100.00. Accordingly, the purchase variance is LCY 10.00.

LCY 10.00 is credited to the purchase variance account.

The user posts an item charge of LCY 20.00. Accordingly, the actual cost is increased to LCY 110.00, and the value of the purchase variance becomes LCY 10.00.

LCY 20.00 is debited to the purchase variance account. Accordingly, the net purchase variance becomes LCY 10.00.

The user revalues the item from LCY 100.00 to LCY 70.00. This does not affect the variance calculation, only the inventory value.
The following table shows the resulting value entries.
Determining the Standard Cost
The standard cost is used when calculating variance and the amount to capitalize. Since the standard cost can be changed over time because of manual update calculation, you need a point in time when the standard cost is fixed for variance calculation. This point is when the inventory increase is invoiced. For produced or assembled items, the point when standard cost is determined is when the cost is adjusted.
The following table shows how different cost shares are calculated for produced and assembled items when you use the Calculate Standard Cost function.
Cost share  Purchased item  Produced/Assembled item 

Standard Cost  SingleLevel Material Cost + SingleLevel Capacity Cost + SingleLevel Subcontrd. Cost + SingleLevel Cap. Ovhd. Cost + SingleLevel Mfg. Ovhd. Cost  
SingleLevel Material Cost  Unit Cost  
SingleLevel Capacity Cost  Not applicable  
SingleLevel Subcontrd. Cost  Not applicable  
SingleLevel Cap. Ovhd Cost  Not applicable  
SingleLevel Mfg. Ovhd Cost  Not applicable  (SingleLevel Material Cost + SingleLevel Capacity Cost + SingleLevel Subcontrd. Cost) * Indirect Cost % / 100 + Overhead Rate 
Rolledup Material Cost  Unit Cost  
Rolledup Capacity Cost  Not applicable  
Rolledup Subcontracted Cost  Not applicable  
Rolledup Cap. Overhead Cost  Not applicable  
Rolledup Mfg. Ovhd Cost  Not applicable 