Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I'm totally new to power bi and I'm using this measure to compare two tables. It worked on the first two tables but when I tried it on another tables then for some reason it was not working so I figured that maybe I should try to really understand how the measure works so I can properly troubleshoot why it is not working on those tables.
Is Contained in Table 2 = IF ( CONTAINS ( Table2, Table2[Code], MAX ( Table1[Code] ), Table2[Code2], MAX ( Table1[Code2] ), Table2[Date], MAX ( Table1[Date] ) ), 1, 0 )
Thank you very much!
Solved! Go to Solution.
This looks at the maximal Code, Code2, and Date values of Table1 within the current filter context and checks if there is a row in Table2 that matches all of these values. (If there isn't any local filter context, it's the max over the entire Table1.)
This documentation for CONTAINS might help a bit:
CONTAINS returns True or False. IF turns this into 1 or 0, respectively.
IF ( <LogicalTest>, <ResultIfTrue>, <ResultIfFalse> )
This looks at the maximal Code, Code2, and Date values of Table1 within the current filter context and checks if there is a row in Table2 that matches all of these values. (If there isn't any local filter context, it's the max over the entire Table1.)
This documentation for CONTAINS might help a bit:
What about the 1 and 0 at the end though?
CONTAINS returns True or False. IF turns this into 1 or 0, respectively.
IF ( <LogicalTest>, <ResultIfTrue>, <ResultIfFalse> )
User | Count |
---|---|
126 | |
108 | |
99 | |
63 | |
62 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |