Forum Discussion
Niels_NL
10 years agoAdvocate I
Formatting from Text-type to Date-type
Hello all, I am creating a new column that gives a True/False output based on whether a particular column contains particular values. Situation: I want to know whether a customer purchased somet...
Greg_Deckler
10 years agoCommunity Champion
Not sure you can get there with CONTAINS using a date. Have only ever used CONTAINS with numeric and text values. You might try changing your formula to a CALCULATE using COUNT, COUTA or COUNTROWS with a FILTER statement to replace your CONTAIN statements. Oh, and wrap it all in an IF statement to get you to your true/false value.
- Niels_NL10 years agoAdvocate I
Well, I figured out a different way while still using the CONTAINS function.
Instead, I used the DATE function to properly convert dates to the date-type:
Column1 = AND( CONTAINS(tbl_Revenue2016;tbl_Revenue2016[Customer];tbl_Customers[Customer]; CONTAINS(tbl_Revenue2016;tbl_Revenue[Date];DATE(2016;2;1)) )
This seems to work as well, as I am not getting an errormessage anymore.
Of course, with an IF statement around it to be able to get a True/False output, as you said.