I have a fact table with the following structure:
PeriodID, AccountID, FlagID, Value1
PeriodID, AccountID and FlagID all link to different dimensions Value1 is a numeric value, with a Sum() measure specified on it in the cube
Assume the following data:
PeriodID, AccountID, FlagID, Value1
20140101, 123 , 1 , 100
20140201, 123 , 2 , 200
20140301, 123 , 1 , 300
My requirement is to build an Excel CubeValue formula which returns Value1 for the last Period in the quarter (i.e. 20140301), if FlagID had a value of 2 at any point in that quarter.
I managed to retrieve Value1 for each AccountID, for the last month of the quarter. What is left is to filter out records whose FlagID was never set to 2 during the quarter.
How would you go about this? What changes to the cube would need to be in place to support this logic in excel? Can one somehow link a fact to itself just like you would like a fact to a dimension?