Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I have two tables. Table1 contains let's say 15,500,000 rows and table2 contains 15,263,123 rows.
In table 1, I have the field UniqueKey1 and in Table 2 I have the field UniqueKey2.
In principle, all the UniqueKey2 values should be found in UniqueKey1. I want to set a flag1 to check if the UniqueKey1 exist in UniqueKey2.
As my two tables are huges, I limited by the memory issue of power bi.
What's the best way to do that?
Thanks in advance for your help
Solved! Go to Solution.
Hi @Anonymous
I would created a calculated column:
NewColumn = IF ( Table1[UniqueKey1] IN DISTINCT ( Table2[UniqueKey2] ), 1, 0 )
Since the large majority of NewColumn values will be 1, the engine will be able to compress that NewColumn a lot and thus it won't take up too much additional space.
Hello. Is this being done in power Query? I am using it but I got a missing coma error.
Thanks!
Hi @Anonymous
I would created a calculated column:
NewColumn = IF ( Table1[UniqueKey1] IN DISTINCT ( Table2[UniqueKey2] ), 1, 0 )
Since the large majority of NewColumn values will be 1, the engine will be able to compress that NewColumn a lot and thus it won't take up too much additional space.
Hello,
I have test your solution it works perfectly. However, as I am new Power BI user, could you please explain me how this code works because I have never use distinct in?
Thanks for your help.
Sure.
DISTINCT gives you all the distinct values in the column, in this case all UniqueKey 2.
Then, for each row in the first table, we check whether that UniqueKey1 is in the list of Unique Keys 2,. If so, we return a 1; otherwise a 0. If you find this helpful, please consider kudoing the posts. Check these out:
Cheers
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
99 | |
76 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |