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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply

Help resolving error with dates in pbix columns - add 'N/A'

Hello, 

 

I'm new to powerbi, the issue I'm having right now is that the date columns are formatted as Dates but also need to include 'N/A' for some fields. Since the content type is set as dates, the N/A fields are being shown as 'Error' and any blanks are shown as 'Null' what can I do so that this column shows N/A instead of error for my dates 

powerbinewbie26_0-1706806445693.png

 

1 ACCEPTED SOLUTION
dufoq3
Super User
Super User

Hi @powerbinewbie26, but don't forget that you can't mix data types in same column

dufoq3_0-1706807039910.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMtY1NNI1NFWK1QFzTXQNDHUNkLlGQBEwF0z46TsiOCAF+gZG+kYWSrGxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t]),
    Ad_DateCorrected = Table.AddColumn(Source, "Date Corrected", each try Date.From([Date]) otherwise "N/A")
in
    Ad_DateCorrected

Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

View solution in original post

3 REPLIES 3
dufoq3
Super User
Super User

Hi @powerbinewbie26, but don't forget that you can't mix data types in same column

dufoq3_0-1706807039910.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMtY1NNI1NFWK1QFzTXQNDHUNkLlGQBEwF0z46TsiOCAF+gZG+kYWSrGxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t]),
    Ad_DateCorrected = Table.AddColumn(Source, "Date Corrected", each try Date.From([Date]) otherwise "N/A")
in
    Ad_DateCorrected

Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

thank you!! 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

Top Solution Authors