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.
I want to create a new column that classifies IDs based on whether they are seen in combination with another specific value.
I have tried with IF, IF contains and look-up functions but with no luck. I just get a replication or count of 'SomeValue'. What I want is to set 'Y' or '1' in the new column whenever an ID has 'X' in SomeValue no matter the frequency.
The HasX should be the desired outcome as shown below
ID | SomeValue | HasX? |
1 | Y | |
1 | X | Y |
1 | Y | |
2 | Y | |
2 | X | Y |
3 | N | |
4 | N | |
4 | N |
Solved! Go to Solution.
Hi,
try this:
hi @Walid_Abou
try to add a column like:
Column =
VAR _list =
CALCULATETABLE(
VALUES(data[SomeValue]),
data[ID]=EARLIER(data[ID])
)
RETURN
IF(
"X" IN _list,
"Y", "N"
)
it worked like:
Hi,
try this:
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
20 | |
7 | |
6 | |
5 | |
5 |
User | Count |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |