Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
I have the below table In which Final Value is my output column
It is supposed to be calculated such that if
Case 1: For Each Anchor Config and Target Config Combination, If Compare value has at least 1 Yes value then all rows become Yes.
Case 2: For Each Anchor Config and Target Config Combination, If Compare value has no Single Yes value then all rows become No
Anchor Config | Target Config | Compare Value | Final Value |
101 | 102 | No | Yes |
101 | 102 | No | Yes |
101 | 102 | Yes | Yes |
101 | 102 | Yes | Yes |
110 | 120 | No | No |
110 | 120 | No | No |
110 | 120 | No | No |
110 | 120 | No | No |
Solved! Go to Solution.
Hi @Anonymous ,
Here’s my DAX, which is a column:
F_value =
VAR x =
FILTER(
Sheet4,
[Anchor Config] = EARLIER([Anchor Config]) && [Target Config] = EARLIER([Target Config])
)
VAR y =
CONTAINS(
x,
[Compare Value],
"Yes"
)
RETURN
IF(
y = TRUE(),
"Yes",
"NO")
And here’s my test result:
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Here’s my DAX, which is a column:
F_value =
VAR x =
FILTER(
Sheet4,
[Anchor Config] = EARLIER([Anchor Config]) && [Target Config] = EARLIER([Target Config])
)
VAR y =
CONTAINS(
x,
[Compare Value],
"Yes"
)
RETURN
IF(
y = TRUE(),
"Yes",
"NO")
And here’s my test result:
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Lionel,
It works. Thanks. But can you also explain the DAX to me? I'm not a regular user of advanced DAX functions.
Hi @Anonymous ,
First, return a table by grouping two columns: [Anchor Config] & [Target Config], the function I used is "EARLIER()":
Second, determine if there is a 'yes' in the table (the table is the first step's return ), the function I used is "CONTAINS()":
At last, use IF function to return the column.
If you understand the 'Context' in DAX, it will be easy.
Row context & filter context
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
71 | |
57 | |
38 | |
36 |
User | Count |
---|---|
81 | |
67 | |
62 | |
46 | |
45 |