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.
Ashish_Mathur
Super User
6 years agoHi,
Ensure that to your visual, you drag Date from the DimDate table. Also, there should be a relationship from the Date column of the iOS & Android Deletions table to the Date column of the DimDate table.