Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Mapping IP Addresses Example

Hi!


I am trying to map ip addresses on Power BI.

I have referenced both of these (and a couple other articles):

https://community.powerbi.com/t5/Desktop/IP-address-mapping/td-p/138436

https://community.powerbi.com/t5/Desktop/IP-address-mapping-and-privacy-levels/td-p/224109

 

Here is a very simplified version of my data:

ip_example.PNG

 

 

1. I create a custom function:

 

 

	let
    Source = (#"IP Address" as text) => let
        Source = Json.Document(Web.Contents("http://freegeoip.net/json/" & #"IP Address")),
        #"Converted to Table" = Record.ToTable(Source),
        #"Transposed Table" = Table.Transpose(#"Converted to Table"),
        #"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table")
    in
        #"Promoted Headers"
in
    Source

 

2. I try to invoke the function and get this error:

 

"Formula.Firewall: Query 'New Students' (step 'Invoked Custom Function') is accessing data sources that have privacy levels which cannot be used together. Please rebuild this data combination.

 

3. I tried to reference this article to fix the problem (https://blog.crossjoin.co.uk/2017/06/26/data-privacy-settings-in-power-bipower-query-part-3-the-form...), but I am a DAX dummy and cannot apply it…

 

Can someone please give me an example of how to properly call this custom function and mapping the IP addresses?

 

PS - My data is private and I cannot change it to public.

Thank you!!

3 REPLIES 3
v-lid-msft
Community Support
Community Support

Hi @Anonymous ,

 

If your data is confidential, the mapping address function is not a effective solution because it will send ip to the api to get the address. So You can try to import a full version of geo ip database into Power BI, and combine with your data in Power Query Editor.

 

Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

@v-lid-msftthanks for the reply!

I was exploring and thought perhaps I could use this to get the country geolocation.
The file is a SQL file... how could I use this in Power BI?

 

http://www.ip2nation.com/ip2nation

 

Thank you!

Hi @Anonymous ,

 

We can import the sql file into a SQL Server then use the Power BI to connect it, or just export it as a excel and import it into Power BI.

 

Or you can download GeoLite2 Country database with a csv format from maxmind and import it into the powerbi.

 

Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.