Forum Discussion

Erik_VM's avatar
Erik_VM
New Member
3 years ago
Solved

Map visualisation shows wrong country for countrycode GB

Hi

I am new to PowerBI, but has managed to make a very nice turnover report with Map visualisation

I have a customer tabel from Business Central with country codes. Unfortunately Power BI map visualisation translates the Business Central code GB (For Great Brittain) to Guinea-Bissau, and my turnover (on the map) ends up in West Africa.

How do I correct the Map to show Great Brittain instead ?

  • Hi Erik

     

    Download example PBIX file

     

    You will have to add custom columns in Power Query for the Country and Country code like so (or can be done in DAX if you like but you'll be pulling in data with PQ so may as well do it there) 

     

    = if [Country] = "Great Britain" then "United Kingdom" else [Country]

     

     

    for the Country Code

     

    = if [Country Code] = "GB" then "UK" else [Country Code]

     

     

    Giving this.

     

     

    Then delete the original columns and rename the new ones with the deleted column names

     

     

    Set the Data Category for both columns to Country and you can then map data using with either the Country Name or Country Code

     

     

     

    With all that said, you are right, the correct ISO standard code GB is for Great Britain and Guinea-Bissau is GW.  So it looks like these ISO codes are not implemented correctly in Power BI.

     

    You can report this bug here

     

    Issues - Microsoft Fabric Community

     

    Regards

     

    Phil

     

     

3 Replies

  • Hi Erik

     

    Download example PBIX file

     

    You will have to add custom columns in Power Query for the Country and Country code like so (or can be done in DAX if you like but you'll be pulling in data with PQ so may as well do it there) 

     

    = if [Country] = "Great Britain" then "United Kingdom" else [Country]

     

     

    for the Country Code

     

    = if [Country Code] = "GB" then "UK" else [Country Code]

     

     

    Giving this.

     

     

    Then delete the original columns and rename the new ones with the deleted column names

     

     

    Set the Data Category for both columns to Country and you can then map data using with either the Country Name or Country Code

     

     

     

    With all that said, you are right, the correct ISO standard code GB is for Great Britain and Guinea-Bissau is GW.  So it looks like these ISO codes are not implemented correctly in Power BI.

     

    You can report this bug here

     

    Issues - Microsoft Fabric Community

     

    Regards

     

    Phil

     

     

  • Erik_VM 

     

    Change GB to UK.  The correct full name for the country is the United Kingdom of Great Britain and Northern Ireland.

     

    Phil

    • Erik_VM's avatar
      Erik_VM
      New Member

      Hi Philip

      Your solution is of course obvious, but in reality Busines Central codes cannot be changed. BC is one of the biggest ERP solutions in the world and I wonder why they would choose a code that is not right. If I google country codes GB is meant for Great Brittain.

      Is there a way to transform the data entry "GB" to "UK"  from BC when the customer tabel is loaded in PowerBI. I suppose PowerBI will identify UK as Great Brittain ?

      Br Erik