Hi Ashish,
This calcualtion is a bit harder. Here is my description:
You have 2 tables:
Table 3 has fields Date, Value and ID
Table 4 has field Date
You should load both of these tables into PowerPivot and create relationship.
Create Pivot.
Now drop Date field from Table 4 into rows area.
Add new pivot calculation:
=IF(CountRows(VALUES(Table4[Date]))<> 1
, Blank()
, CALCULATE(
COUNTROWS(
DISTINCT(Table3[ID]
)
)
, All(Table4[Date])
, Table3[Date]< VALUES(Table4[Date])
)
)
Test and see if your results are what you were expecting. In formula above I filter table Table3 to include just records with Date value less than curent value of the Table4 Date for each row.