Forum Discussion
IP address to locational subnets
- 1 year ago
One approach would be to use Power Query to split the start and end ranges, and user IP, into their constituent parts. I'm guessing that you don't need the last part, e.g. if the IP address was 192.168.5.4 you would only need 192, 168 and 5 as separate columns.
Use Power Query to add in index column to the office table, unless it already has a unique ID in which case you can use that.
Add a calculated column to the table which has the user IP address like
Office Index = SELECTCOLUMNS ( FILTER ( Offices, Offices[Start IP1] <= 'Table'[IP1] && Offices[End IP1] >= 'Table'[IP1] && Offices[Start IP2] <= 'Table'[IP2] && Offices[End IP2] >= 'Table'[IP2] && Offices[Start IP3] <= 'Table'[IP3] && Offices[End IP3] >= 'Table'[IP3] ), "@val", Offices[Index] )It would also be possible to create this column using Power Query if necessary.
You can now link the office table to the table with the IP addresses using the index column.
One approach would be to use Power Query to split the start and end ranges, and user IP, into their constituent parts. I'm guessing that you don't need the last part, e.g. if the IP address was 192.168.5.4 you would only need 192, 168 and 5 as separate columns.
Use Power Query to add in index column to the office table, unless it already has a unique ID in which case you can use that.
Add a calculated column to the table which has the user IP address like
Office Index =
SELECTCOLUMNS (
FILTER (
Offices,
Offices[Start IP1] <= 'Table'[IP1]
&& Offices[End IP1] >= 'Table'[IP1]
&& Offices[Start IP2] <= 'Table'[IP2]
&& Offices[End IP2] >= 'Table'[IP2]
&& Offices[Start IP3] <= 'Table'[IP3]
&& Offices[End IP3] >= 'Table'[IP3]
),
"@val", Offices[Index]
)
It would also be possible to create this column using Power Query if necessary.
You can now link the office table to the table with the IP addresses using the index column.