Forum Discussion

EvanGetsItDone's avatar
3 years ago
Solved

How Do I Convert a Date Column to A Measure?

Hello,

I need to convert my 'calendar'[Date] column to a measure. 

In my scenario, I cannot use MAX('calendar'[Date]) or SELECTEDVALUE('calendar'[Date]),MIN('calendar'[Date]), etc. 
I just need the plain 'calendar'[Date] to be converted or somehow aggregiated in to a measure. Im not sure which function to use. 

I need to use the [Date] in to a condition, 
IF(Month(???(calendar[Date])) = MONTH(TODAY()), ... , ....)

I need a function on the ??? part. 

Thanks!

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi EvanGetsItDone ,

     

    Why can't use the MAX or MIN function to reference the date in the calendar?

    Please provide some sample data and expected results in detail.

    I made an example on my own. In this example, the MAX function refers to the date of the current row of the calendar.

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi EvanGetsItDone ,

     

    Why can't use the MAX or MIN function to reference the date in the calendar?

    Please provide some sample data and expected results in detail.

    I made an example on my own. In this example, the MAX function refers to the date of the current row of the calendar.

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Anonymous ,

       

      I am facing a similar issur in which i am trying to create a measure in which i have to use If condition in which i am comparing my delivery date column with today dates and it's not working . I have to compare all dates and due to that i am not able to use Min, Max, Selected value etc function .

      Is there any way where you can help. Please see below screenshot of the sample data and Measure which i created :