Is it possible to get location country out of location string which doesn't include a country. Let's say I have a column of locations and I want to add a custom column with location country which I want to get from locations column. For example:
You need more than city to get a country. A city is not unique across a country (ex: Paris, IL USA). Your string, at the minimum, should contain the City and State/Region. There are paid services that will give you a list of every Country / Region / Cities / Latitude & Longitude. I would start by concatenating the city and state/region on both sides (your table and look up table) and use that join as a look up value to find the Country.
I am aware of all of that but the problem is that I don't have all that information. I also know that google maps API includes a function that can return better location string (including country, city, street and post code) if you give it just a city or just a street. It gives you a suggestion it thinks it is the right one and that would be good enough. My question is, does PowerBI include such a function in M language or DAX? If there is no such a function than I will use google maps API, but it would be easier to just correct the data inside queries in PowerBI.
I am personally not aware of any such function. My understanding is that the results are exact from the mapping calls. It makes a determination on its own where the city belongs based on the information you provide. I could be wrong, but in the experimentation I have done, the more information I am able to plot with the city, the more accurate the results. I have not used the street address in Power BI so I can't comment on that.
If Google is also taking a guess based on the info you are providing it, then you are in the same boat regardless of which API you use. My suggestion is then to try both and see which algorithm you prefer. Good luck.