Forum Discussion

powerbinewbie26's avatar
2 years ago
Solved

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, ...
  • dufoq3's avatar
    2 years ago

    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