Forum Discussion

dgyurdieva's avatar
dgyurdieva
Frequent Visitor
9 years ago

Locating users based on IP takes too long

Hi, 

So I have 2 tables - 1 with users and the other with IP ranges (3 columns (ipfrom, ipto, country).
The formula that I am trying to use is the following: 

Country = CALCULATE(VALUES('table1_ranges'[countryName]);filter('table1_ranges';'table2'[ip]>('table1_ranges'[ipFrom]-1) && 'table2'[ip] <= 'table1_ranges'[ipTo]))

 

However, it takes too long to calculate and does not even finalize the calculations it just keeps "Working on it" for very long time and then I close it. 
I've already minimized the number of tables, row and columns as much as possible.

Table 1 is with 370 000 rows and table 1 with 1 000 000.

 

Is there another solution for matchin IP with a range so that I can ge the country?

 

Thanks you

2 Replies

  • v-caliao-msft's avatar
    v-caliao-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    dgyurdieva,

     

    370 000 rows is not too large for Power BI. In your scenario, could you please provide us the detail table structure with some sample data and your expected result, so that we can make further analysis.

     

    Regards,

    Charlie Liao

    • dgyurdieva's avatar
      dgyurdieva
      Frequent Visitor

       Ok so I have 3 tables : 

      userIdusernameipipnumber
      1a127.255.555.6662147483647
      2s127.255.555.6672147483648
      3d127.255.555.6682147483649
      4f127.255.555.6692147483650
      5g127.255.555.6702147483651

       

      ipFromipToCountry
      3460505634605311USA
      32789427883278942789Germany
      21474836472147483653Poland
      21574836692157483670UK
      31133214723113322495Austria

       

      Those two I use to get the country name for the respective idnumber. 

       

      The third table is used to get the users that actually played games during some period and get the game the played and the platform. 

       

      platformuseriddategame
      a11.7.2017asd
      b11.7.2017fgh
      c23.7.2017asd
      d33.7.2017asd
      e33.7.2017fgh

       

      The formula for getting the country name is inserted as a column in the first table.