Forum Discussion

JCortez's avatar
JCortez
Frequent Visitor
1 year ago
Solved

Copy only Date Values into New Column

I have a column which has dates and other values (answers to questions). Is it possible to create a new column only copying the date values and excluding the other data? If so, how can I do this? ...
  • DataVitalizer's avatar
    DataVitalizer
    1 year ago

    Hi JCortez 

    You can create a new column in DAX that keeps only the date values and returns blank for anything else using this code

     

    DateOnlyColumn = 
    IF (
    ISBLANK([YourColumn]),
    BLANK(),
    IF (
    NOT(ISERROR(DATEVALUE([YourColumn]))),
    DATEVALUE([YourColumn]),
    BLANK()
    )
    )

     

    Did it work? 👍 A kudos would be appreciated
    🟨 Mark it as a solution to help spread knowledge 💡

     

    🟩 Follow me on LinkedIn

  • DataVitalizer's avatar
    DataVitalizer
    1 year ago

    Hi JCortez 

    Happy for you.

     

    Did it work? 👍 A kudos would be appreciated
    🟨 Mark it as a solution to help spread knowledge 💡

     

    🟩 Follow me on LinkedIn