Forum Discussion
A function 'DATESBETWEEN' has been used in a True/False expression that is used as a table filter
- 3 years ago
Hi Anonymous ,
If you need the admin not to be in that period then you should use something similar to this:
# Seen 08/01/2022-03/31/2023 and Admin equals Recorded 08/01/2022-03/31/2023 = VAR _table = CALCULATETABLE ( 'PT BASE', DATESBETWEEN ( 'PT BASE'[EncounterDTTM], DATE ( 2022, 08, 01 ), DATE ( 2023, 03, 31 ) ), NOT( DATESBETWEEN ( 'PT BASE'[Vaccine Administered Date], DATE ( 2022, 08, 01 ), DATE ( 2023, 03, 31 ) )), DATESBETWEEN ( 'PT BASE'[Vaccine Recorded Date], DATE ( 2022, 08, 01 ), DATE ( 2023, 03, 31 ) ) ) RETURN COUNTROWS ( _table ) + 0Again without data is diffiicult to pin point if this works.
Hi! mfeyx I am hoping to piggy back off of this post. I have a very similar issue and I am trying to find a distinct count of ID numbers who have donated before a certain date, after a certain date, and NOT during a certain date range. I have tried to modify this as
- MFelix2 years ago
Super User
Hi
The problem is that you did not defined the variable just need toadd vat _table.
Here is the full code
Retention measure =
VAR _table =
CALCULATETABLE (
'Table1',
DATESBETWEEN ( Table1[Gift date], DATE ( 2023, 07, 01 ), DATE ( 2024, 06, 30 ) ),
NOT (
DATESBETWEEN ( Table1[Gift date], DATE ( 2022, 07, 01 ), DATE ( 2023, 60, 30 ) )
),
DATESBETWEEN ( Table1[Gift date], DATE ( 1980, 01, 01 ), DATE ( 2022, 06, 30 ) )
)
RETURN
COUNTROWS ( _table ) + 0- JCDaling062 years agoRegular Visitor
Hi! Thanks for you response! When i modified that I got this error message "The True/False expression does not specify a column. Each True/False expressions used as a table filter expression must refer to exactly one column." not sure what to do with that.
Thanks!