Forum Discussion
Issue about CALCULATETABLE
- 5 years ago
CNENFRNL
Yes, CALCULATETABLE creates a context transition but FILTER doesn't. In your case, if you look at the arguments in CALCULATETABLE, after you have applied 'Calendar'[Date] >= __date, you remove filters using ALL ( 'Calendar'[Date] ), that is the reason all dates are in the result. But if you apply VALUES to respect the filters then you can get the correct results with the same formula.Corrected = VAR __date = MAX ( 'Calendar'[Date] ) RETURN CONCATENATEX ( CALCULATETABLE ( VALUES('Calendar'[Date] ), 'Calendar'[Date] > __date ), 'Calendar'[Date], UNICHAR ( 10 ) )________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
CNENFRNL
Yes, CALCULATETABLE creates a context transition but FILTER doesn't. In your case, if you look at the arguments in CALCULATETABLE, after you have applied 'Calendar'[Date] >= __date, you remove filters using ALL ( 'Calendar'[Date] ), that is the reason all dates are in the result. But if you apply VALUES to respect the filters then you can get the correct results with the same formula.
Corrected =
VAR __date = MAX ( 'Calendar'[Date] )
RETURN
CONCATENATEX (
CALCULATETABLE ( VALUES('Calendar'[Date] ), 'Calendar'[Date] > __date ),
'Calendar'[Date],
UNICHAR ( 10 )
)________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂