Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Can someone help me with a formula for a calculated column that makes it possible to show only records that have two items A and B within the same number?
Example data:
NR | Item |
1 | A |
1 | B |
2 | A |
3 | A |
3 | B |
4 | A |
5 | A |
5 | C |
THe result i'm looking for is:
NR | Item |
1 | A |
1 | B |
3 | A |
3 | B |
Solved! Go to Solution.
Here's a column expression that returns T/F for Numbers 1 and 3 rows.
ABonly =
VAR items =
CALCULATETABLE ( DISTINCT ( T1[Item] ), ALLEXCEPT ( T1, T1[NR] ) )
VAR AB = { "A", "B" }
RETURN
COUNTROWS ( INTERSECT ( items, AB ) ) = 2
&& COUNTROWS ( items ) = 2
Pat
Here's a column expression that returns T/F for Numbers 1 and 3 rows.
ABonly =
VAR items =
CALCULATETABLE ( DISTINCT ( T1[Item] ), ALLEXCEPT ( T1, T1[NR] ) )
VAR AB = { "A", "B" }
RETURN
COUNTROWS ( INTERSECT ( items, AB ) ) = 2
&& COUNTROWS ( items ) = 2
Pat
User | Count |
---|---|
73 | |
72 | |
39 | |
25 | |
23 |
User | Count |
---|---|
96 | |
93 | |
51 | |
43 | |
42 |