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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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