Hi,
I've got a fact table with 'effective dates' and this maps to a common dimension of what that record was effective... which is what i think is very similar to a foreign exchange fact table. the comparison becomes stronger in fact when you learn that a value in this table needs to be used to change a value in another table, just like FX would... here is my model at present:
There are no calculations involved in order to the measure 'Correct' working, other than the following DAX statement:
That's it, it works.. lovely... we do the calculation at the leaf level and everything rolls up nicely.
The issue i'm having is when the 'Split' table (this could be considered an FX rate table) does not have an explicit value for a Date and SaleAgent combination.. so i was messing about with attempting to 'fill in' with the last known data, while still retaining the relationship to date.... here is the data in the split table:
obviously there is a gap here with no data for the 3rd of Jan... if there was a sale on the 3rd of Jan though, we need to use the LastKnown data for that SaleAgent. In this case it comes from the 2nd Jan. Anyone have any ideas on how i can achieve this?
My thoughts are:
1) 'Fill in' the gaps in a view / ETL with everything before the model is processes
2) Disable the relationship of the 'Split' table from Date and SaleAgent and then fill in the whole with dax and then utilise the USERELATIONSHIP function in the calcualtion
I have uploaded a sample workbook to OneDrive: http://1drv.ms/1wmlExp
I've got a fact table with 'effective dates' and this maps to a common dimension of what that record was effective... which is what i think is very similar to a foreign exchange fact table. the comparison becomes stronger in fact when you learn that a value in this table needs to be used to change a value in another table, just like FX would... here is my model at present:
There are no calculations involved in order to the measure 'Correct' working, other than the following DAX statement:
Correct :=SUMX (
Split,
CALCULATE (
SUM ( Sales[Value] ) * VALUES ( Split[Multipler] )
)
)
That's it, it works.. lovely... we do the calculation at the leaf level and everything rolls up nicely.
The issue i'm having is when the 'Split' table (this could be considered an FX rate table) does not have an explicit value for a Date and SaleAgent combination.. so i was messing about with attempting to 'fill in' with the last known data, while still retaining the relationship to date.... here is the data in the split table:
obviously there is a gap here with no data for the 3rd of Jan... if there was a sale on the 3rd of Jan though, we need to use the LastKnown data for that SaleAgent. In this case it comes from the 2nd Jan. Anyone have any ideas on how i can achieve this?
My thoughts are:
1) 'Fill in' the gaps in a view / ETL with everything before the model is processes
2) Disable the relationship of the 'Split' table from Date and SaleAgent and then fill in the whole with dax and then utilise the USERELATIONSHIP function in the calcualtion
I have uploaded a sample workbook to OneDrive: http://1drv.ms/1wmlExp