Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello,
I have the following sample data
| ID | DATA |
| 1 | A |
| 1 | A |
| 2 | A |
| 2 | B |
| 3 | B |
My need is to create a third column, which will check for each ID,
if there is at least and only A then list A
if there is at least and only B then list B
Else (there is at least one A and one B then A & B
| ID | DATA | Result |
| 1 | A | A |
| 1 | A | A |
| 2 | A | A&B |
| 2 | B | A&B |
| 3 | B | B |
Thanks for your help.
Regards,
Solved! Go to Solution.
hi @MB_PowerBI
try to add a column like this:
Result2 =
VAR _id = [ID]
VAR _table=
CALCULATETABLE(
VALUES(TableName[Data]),
ALL(TableName),
TableName[ID] = _id
)
RETURN
CONCATENATEX(
_table,
TableName[Data],
"&"
)
it works like this:
For fun only, a showcase of powerful Excel worksheet formula,
| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
hi @MB_PowerBI
try to add a column like this:
Result2 =
VAR _id = [ID]
VAR _table=
CALCULATETABLE(
VALUES(TableName[Data]),
ALL(TableName),
TableName[ID] = _id
)
RETURN
CONCATENATEX(
_table,
TableName[Data],
"&"
)
it works like this:
or something like this:
Result2 =
VAR _table=
CALCULATETABLE(
VALUES(TableName[Data]),
ALLEXCEPT(TableName, TableName[ID])
)
RETURN
CONCATENATEX(
_table,
TableName[Data],
"&"
)
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 20 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 32 | |
| 31 | |
| 18 | |
| 12 | |
| 11 |