Forum Discussion
Anonymous
6 years agoNot applicable
Measure using DIM date table error
Hi, I am trying to move a Measure from a local date to a DIM Date as I need to compare two different tables. Date Deletions Deletions prior to 31 days ago Number of deletions in past 3...
- Anonymous6 years ago
Hi Anonymous
I build a new Deletions prior to 31 days ago _ DIMDATE Measure:
Number of deletions in past 31 days_DimDate = VAR _CURRENTDimDATE = MAX ( DimDate[Date] ) VAR _MINDATE = MINX ( ALL ( Deletions ), Deletions[Date] ) VAR _MAXDATE = MAXX ( ALL ( Deletions ), Deletions[Date] ) RETURN IF ( OR ( _CURRENTDimDATE < _MINDATE, _CURRENTDimDATE > _MAXDATE ), BLANK (), CALCULATE ( SUM ( 'Deletions'[Deletions] ), DATESBETWEEN ( DimDate[Date], MAX ( 'Deletions'[Date] ) - 31, MAX ( 'Deletions'[Date] ) ) ) )Result:
You can download the pbix file from this link: Measure using DIM date table error
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
lbendlin
6 years agoSuper User
Use a variable to capture your current date value before entering the CALCUALATE() area, and reference the date by the variable.