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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
it
New Member

Relationship Query

I'm new to Power BI and trying to figure out how to utilise relationship data between 2 csv's and would appreciate it if someone here can assist.

 

Example:

I have a CSV file with computer IP addresses on them, eg 192.168.1.101 and another CSV of all the subnets that we have, eg Office: Australia, Subnet: 192.168.1.0/24

 

Query:

Is there a way for me to link the 2 csv's together and have Power BI display which Office the computer belongs to?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

A really quick solution would be a calculated column in your computer table:

 

Subnet = LEFT([IP], 5) & ".0.0/24")

 

 

Now go to your table relationships tab and link your computers to your locations via the subnet.

 

Now add the matrix visual to your reports and you'll see if you list the computers, then if you bring in your Office field from your office list, it will correctly show.

View solution in original post

3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

So, yes. What you would want to do would be to create a calculated column on your IP addresses table that determines that IP addresses' subnet (even better if it is already there) then you could relate the two tables. Sample data would help tremendously.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi smoupre

 

Thanks for your reply.

Example: 

 

OfficeSubnet
NSW10.10.0.0/24
QLD10.20.0.0/24
VIC10.30.0.0/24

 

DescriptionSerialIP
Desktop1234N12310.20.0.50
Laptop2345M67810.10.0.108
Server3456O78910.30.0.167

 

So what I would like to achieve as an end result is link both tables in 2 different CSV files together and have Power BI show the following table based by the IP in the second table and automatically populate the Office from the first table. Hope i'm making sense 🙂

 

DescriptionSerialIPOffice
Desktop1234N12310.20.0.50 
Laptop2345M67810.10.0.108 
Server3456O78910.30.0.167 
Anonymous
Not applicable

A really quick solution would be a calculated column in your computer table:

 

Subnet = LEFT([IP], 5) & ".0.0/24")

 

 

Now go to your table relationships tab and link your computers to your locations via the subnet.

 

Now add the matrix visual to your reports and you'll see if you list the computers, then if you bring in your Office field from your office list, it will correctly show.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors