Forum Discussion

-Enric-'s avatar
-Enric-
Regular Visitor
2 years ago
Solved

Decompress Base64 code from Json File?

Good afternoon community, I have a table used as Master data that follows the following format 2-digit 3-digit Country Market BG BGR BULGARIA EAST CZ CZE CZECH REPUBLIC EAST HR...
  • AlexisOlson's avatar
    2 years ago

    This is the standard way Power BI encodes data created using the Enter Data interface.

     

    As mentioned in a previous thread, you can modify this data by clicking on the gear icon next to the first applied step:

     

    FYI, I've written a custom function to convert this sort of table into a more human-readable one. Using this function on your table results in the following (after adding #" " around the first two column names):

    let
      Source = Table.FromRows(
        {
          {"BE", "BEL", "BELGIUM", "BENELUX"},
          {"LU", "LUX", "LUXEMBOURG", "BENELUX"},
          {"NL", "NLD", "NETHERLANDS", "BENELUX"},
          {"AT", "AUT", "AUSTRIA", "DACH"},
          {"CH", "CHE", "SWITZERLAND", "DACH"},
          {"DE", "DEU", "GERMANY", "DACH"},
          {"BG", "BGR", "BULGARIA", "EAST"},
          {"CZ", "CZE", "CZECH REPUBLIC", "EAST"},
          {"HR", "HRV", "CROATIA", "EAST"},
          {"HU", "HUN", "HUNGARY", "EAST"},
          {"MD", "MDA", "MOLDOVA", "EAST"},
          {"PL", "POL", "POLAND", "EAST"},
          {"RO", "ROU", "ROMANIA", "EAST"},
          {"RS", "SRB", "SERBIA", "EAST"},
          {"SK", "SVK", "SLOVAKIA", "EAST"},
          {"SI", "SVN", "SLOVENIA", "EAST"},
          {"FR", "FRA", "FRANCE", "FRANCE"},
          {"AD", "AND", "ANDORRA", "IBERIA"},
          {"ES", "ESP", "SPAIN", "IBERIA"},
          {"GI", "GIB", "GIBRALTAR", "IBERIA"},
          {"PT", "PRT", "PORTUGAL", "IBERIA"},
          {"IT", "ITA", "ITALY", "ITALY"},
          {"SM", "SMR", "SAN MARINO", "ITALY"},
          {"DK", "DNK", "DENMARK", "NORDICS"},
          {"EE", "EST", "ESTONIA", "NORDICS"},
          {"FI", "FIN", "FINLAND", "NORDICS"},
          {"LT", "LTU", "LITHUANIA", "NORDICS"},
          {"LV", "LVA", "LATVIA", "NORDICS"},
          {"NO", "NOR", "NORWAY", "NORDICS"},
          {"SE", "SWE", "SWEDEN", "NORDICS"},
          {"KZ", "KAZ", "KAZAKHSTAN", "RUSSIA"},
          {"RU", "RUS", "RUSSIA", "RUSSIA"},
          {"UA", "UKR", "UKRAINE", "RUSSIA"},
          {"GB", "GBR", "UNITED KINGDOM", "UK"},
          {"IR", "IRL", "IRELAND", "UK"},
          {"UK", "UK", "UNITED KINGDOM", "UK"},
          {"US", "USA", "UNITED STATES", "NORTH AMERICA"},
          {"CA", "CAN", "CANADA", "NORTH AMERICA"}
        },
        type table [#"2-digit" = text, #"3-digit" = text, Country = text, Market = text]
      )
    in
      Source