Forum Discussion
Relationships for Relative Date Filtering
- 6 years ago
Anonymous ,
You can create a date like
Date = date([year], [month],1)
or
Date = "01-" & [Month] & "-" &[Year] // change format Date if Month is format Jan or January
- 6 years ago
Hi Anonymous ,
If the 'Table B'[Month] is like format "January, February ,,,", you may use SWITCH function to change the value data format, then create calculated column [Date] like DAX below, change the data type to Date.
'Table B' [Month] = SWITCH('Table B' [Month] ,"January",1,"February",2,"March",3,"April",4,"May",5,"June",6,"July",7,"August",8,"September",9,"October",10,"November",11,"December",12) Date= 'Table B' [Month] & "/01/" & 'Table B' [Year]Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This generates an error (same one I always recieve) "Cannot convert value '01--' of type Text to type Date.
Hi Anonymous ,
If the 'Table B'[Month] is like format "January, February ,,,", you may use SWITCH function to change the value data format, then create calculated column [Date] like DAX below, change the data type to Date.
'Table B' [Month] = SWITCH('Table B' [Month] ,"January",1,"February",2,"March",3,"April",4,"May",5,"June",6,"July",7,"August",8,"September",9,"October",10,"November",11,"December",12)
Date= 'Table B' [Month] & "/01/" & 'Table B' [Year]
Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.