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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
gourab333
New Member

Replace the blank value with text in a date column

Hi,

I have one date column ,i just want to replace the blank value with some text,

could you help me which DAX fuction i can use.

 

Date
01-02-2020
01-02-2020
09-02-2020
null
04-03-2021
03-03-2021
null
null
05-02-2022

 thanks,

Gourav

1 ACCEPTED SOLUTION
jennratten
Super User
Super User

There are several ways you can do this but it depends on other factors with your data.  For example, if your column if formatted as a date, the new value you use in the replacements must also be a date.  If you'd like the new value to be text like "Missing" then the column will need to be formatted as text.  It would be best to perform the replacement in Power Query.  You can do that by selecting the column, right-click on the column and choose replace values (or select it from the ribbon).  Assuming your field is formatted as a date, enter any date in the old value field and whatever date you'd like to use for the new value in the new value field and click okay.  Then in the formula bar, you should see the script that Power Query generated for the replacement.  Find the value that you entered as the old value to be replaced and change it to null (the word null without any quotation marks. That should do it.

View solution in original post

3 REPLIES 3
v-yingjl
Community Support
Community Support

Hi @gourab333 ,

DAX is a calculation tool, not a transformation tool. If you want to replace values, you need to use Power Query Editor in Power BI Desktop.

 

If the date column type is date, you cannot replace the blank values with text because one column should only have one data type in Power BI.

If the date column type is text or Any type, you can use Replace value feature in Power Query Editor to achieve this. But you cannnot re-convert this column to the date type due to one data type restriction.

See: Replace values and errors 

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

jennratten
Super User
Super User

There are several ways you can do this but it depends on other factors with your data.  For example, if your column if formatted as a date, the new value you use in the replacements must also be a date.  If you'd like the new value to be text like "Missing" then the column will need to be formatted as text.  It would be best to perform the replacement in Power Query.  You can do that by selecting the column, right-click on the column and choose replace values (or select it from the ribbon).  Assuming your field is formatted as a date, enter any date in the old value field and whatever date you'd like to use for the new value in the new value field and click okay.  Then in the formula bar, you should see the script that Power Query generated for the replacement.  Find the value that you entered as the old value to be replaced and change it to null (the word null without any quotation marks. That should do it.

Anonymous
Not applicable

Hi I have time the samecase  but its not working 

kamaldeepin_0-1662627911026.png

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors