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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Change a Date to 0 in a Calculated Column

I am trying stop the FORMAT() function from changing the values: 0 into a date. I want them to remain 0. Currently, the dax transforms 0 into 12/30/1899. I want to stop that from occuring without affecting the values that are being formatted to Date type appropriately.

This is the current Formula for the Calculated ColumnThis is the current Formula for the Calculated Column

1 ACCEPTED SOLUTION
pranit828
Community Champion
Community Champion

Hi @Anonymous 

 

If the format of the column or the formula is data type then you have to change it to 'text' to show '0' in it.

The column has to be either Date or text. We cannot have both, If we have it as date 0 will be converted as you have mentioned.

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

Regards,
Pranit





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile

View solution in original post

4 REPLIES 4
pranit828
Community Champion
Community Champion

Hi @Anonymous 

 

If the format of the column or the formula is data type then you have to change it to 'text' to show '0' in it.

The column has to be either Date or text. We cannot have both, If we have it as date 0 will be converted as you have mentioned.

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

Regards,
Pranit





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile
parry2k
Super User
Super User

@Anonymous it will be easier if you provide the sample data and expected output. Read this post to get your answer quickly.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

I am not allowed to share the dataset due to security concerns.
I only have permissions to share DAX and screenshots of single columns.
In the screenshot below: the calculated column uses the syntax displayed above.
But for all values of '0' i am returning the Date: 12/30/1899 as displayed. All other calculated values are supposed to remain in Date format but i want '0' to remain as the Number '0'. Is this possible?
Annotation.png

@Anonymous you cannot have a column with two data type, if this column is date then 0 will show as that date, instead you make 0 to be as blank rather than 0 value

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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