Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
JCortez
Frequent Visitor

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?

Thank you in advanced.
Javier

2 ACCEPTED SOLUTIONS

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

View solution in original post

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

View solution in original post

9 REPLIES 9
Bmejia
Super User
Super User

Can you add a conditional column that if you have a backlash / then it would select the date on new column.  I understand you might have other text with / might have to add and additional logic if you do.

Bmejia_1-1753905104425.png

 

Bmejia
Super User
Super User

It would be good if yo provided a sample as Solution Sage mention as it may vary.  You can use the Split Column option during the transformation process by highlighting the column and use some type of deliminator.

Bmejia_0-1753903473438.png

 

Sample provided.

DataVitalizer
Solution Sage
Solution Sage

Hi @JCortez 

Could you provide a sample of your column data?

 

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

 

🟩 Follow me on LinkedIn

I would like just the date values copied from the column named Response to the New Column Response (Copy). The non date values can be left blank.

Capture3.JPG

Hi,

This M code works

let
    Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Actual Field", type any}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each if Value.Is([Actual Field], type datetime) then [Actual Field] else null)
in
    #"Added Custom"

Hope this helps.

Ashish_Mathur_0-1753930686116.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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

Thank you so much this worked.

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.