Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

DateValue in combination with Selectedvalue

Hi guys I need to do a calculation for a specific month e.g. april but the year is based on the selected year. I get an error : "Cannot convert value '01/04/' of type Text to type Date" My DAX: CALCUL...
  • v-cherch-msft's avatar
    7 years ago

    Hi Anonymous 

    In your formula,"01/04" is text format,but selectedvalue('Date'[Year]) is number format.They are different types.

     

    DATEVALUE( "01/04"&"/"&selectedvalue('Date'[Year]) )

    You may change the above to below formula.They should be in same number format.

     

    DATE( selectedvalue('Date'[Year]);4;1 )

    Regards,