Forum Discussion
Week over Week Difference
- 7 years ago
Hi mwc ,
I reproduced your question and it didn’t appear any error. You could try it again.
And usually, the reason your error appears is that if it is a measure which is using any date function which expects contiguous date range, bi-directional filter ends up removing some dates and thus it’s no longer a contiguous date range which could be crashing the measure.
So, you can create a new Date Table and manage relationships with your fact tables to solve it.
1. Create a Date Table:
Date Table = CALENDARAUTO()
2. Manage relationships:
3. Create a measure:
Week over Week Difference 2 = ( CALCULATE ( SUM ( 'Inventory History Table'[Inventory $] ), LASTDATE ( 'Date Table'[Date]) ) ) - ( CALCULATE ( SUM ( 'Inventory History Table'[Inventory $] ), DATEADD ( 'Date Table'[Date], -7, DAY ) ) )Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi mwc ,
I reproduced your question and it didn’t appear any error. You could try it again.
And usually, the reason your error appears is that if it is a measure which is using any date function which expects contiguous date range, bi-directional filter ends up removing some dates and thus it’s no longer a contiguous date range which could be crashing the measure.
So, you can create a new Date Table and manage relationships with your fact tables to solve it.
1. Create a Date Table:
Date Table = CALENDARAUTO()
2. Manage relationships:
3. Create a measure:
Week over Week Difference 2 =
(
CALCULATE (
SUM ( 'Inventory History Table'[Inventory $] ),
LASTDATE ( 'Date Table'[Date])
)
)
- (
CALCULATE (
SUM ( 'Inventory History Table'[Inventory $] ),
DATEADD ( 'Date Table'[Date], -7, DAY )
)
)Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks, I think it was the contiguous date issue. The date table helped.