Forum Discussion

TomSinAA's avatar
TomSinAA
Helper IV
1 year ago
Solved

displaying incorrect data

I have a visual displaying data from a MS Access table.  The visual is switching the route field from what is in the MS Access table. MS Access table source data: #Route IdRoute No 32628 4165_...
  • danextian's avatar
    1 year ago

    Hi TomSinAA 

    This is expected behavior. VertiPaq stores and indexes text in a normalized, case-insensitive way, so APPLE, apple, and Apple are treated as the same value, with only the first encountered version kept. While this improves compression and reduces model size, it also means you cannot store two values that differ only by letter casing. A possible workaround is to append an invisible character to the text, repeated according to a defined sort order, so that VertiPaq treats them as unique - you can create a rank column for that sort order (not available in the GUI).

    M Code:

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjYyM7JQ0lEyMTQzjXfKSMxV8EtVMIw3MDc2iPeND1eK1RmcaixR1bgOajWxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"#Route Id" = _t, #"Route No" = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"#Route Id", Int64.Type}, {"Route No", type text}}),
        #"Added Route No Index" = Table.AddRankColumn(
       #"Changed Type",
       "Route No Index",
        {"Route No", Order.Ascending},
         [RankKind = RankKind.Dense]
    ),
        #"Added Custom" = Table.AddColumn(#"Added Route No Index", "Route No2", each [Route No] & Text.Repeat(Character.FromNumber(8203), [Route No Index]), type text),
        #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Route No"}),
        #"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"Route No2", "Route No"}})
    in
        #"Renamed Columns"