Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
I have a table below - And I need a calculated column that gives me the information for Code A, whether the Id already exists or not in code B
| ID | Code |
| 100 | A |
| 102 | A |
| 103 | A |
| 100 | B |
| 101 | B |
So the final table should look like this:
| ID | Code | Exist or Not? |
| 100 | A | Exist |
| 102 | A | New |
| 103 | A | New |
| 100 | B | |
| 101 | B |
Solved! Go to Solution.
X =
VAR _1 =
COUNTX (
FILTER ( Table, [ID] = EARLIER ( [ID] ) && [Code] < EARLIER ( [Code] ) ),
[ID]
) + 0
RETURN
IF ( _1 > 0, "Old", "New" )
X =
VAR _1 =
COUNTX (
FILTER ( Table, [ID] = EARLIER ( [ID] ) && [Code] < EARLIER ( [Code] ) ),
[ID]
) + 0
RETURN
IF ( _1 > 0, "Old", "New" )
| User | Count |
|---|---|
| 54 | |
| 37 | |
| 27 | |
| 18 | |
| 16 |
| User | Count |
|---|---|
| 69 | |
| 57 | |
| 38 | |
| 21 | |
| 21 |