I have a normal structure of Date Dimension (DateKey) & a related Fact table - for the sake of this question, let’s say, a Sales fact table, linked to the Date Dimension table by the DateKey.
Let’s call this Date Dimension “Date A”.
When I put a slicer with date & I choose any date, obviously the Sales table gets filtered. This is already working correctly.
Now, I want to add a second date table into the picture - let’s say the structure is identical to my Date Dimension. The aim is to use this second date slicer as a Comparative Date.
For example: I choose the 8th of April in my first date slicer & the 1st of April in the second date slicer.
Sales amount =
VAR ActualDateKey = SELECTEDVALUE( ‘DateA’[DateKey] )
‘FactSales’[DateKey] = ActualDateKey
Sales amount (comp) =
VAR ComparativeDateKey = SELECTEDVALUE( ‘CompDate’[DateKey] )
‘FactSales’[DateKey] = ComparativeDateKey
The problem here is that Sales amount (comp) is always returning a null value.
Am I missing something here?
Thanks for your reply.
Kind regards, Yogesh