Forum Discussion
powerbinewbie26
2 years agoHelper I
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
Hi powerbinewbie26, but don't forget that you can't mix data types in same column
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
3 Replies
- dufoq3Community Champion
Hi powerbinewbie26, but don't forget that you can't mix data types in same column
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- powerbinewbie26Helper I
thank you!!