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 have a table that has two different columns generating values based off of IF Statements. However, there is some overlap in the logic that causes values to populate in both columns. What I need is a DAX function that does not populate a value in column 2, if that same value is found in any row in column 1. If the value is not already somewhere in column 1, it can populate the value in column 2 See below.
The logic for column 1&2 is essentially:
IF(AND(Test 1 = x, Test 2 = y), Table['Part Number'], "")
Current Data:
Part Number | Column 1 | Column 2 |
1510 | 1510 | 1510 |
1510 | 1510 | 1510 |
1510 | 1510 | 1510 |
1510 | 1510 | |
1510 | 1510 | |
1510 | ||
1700 | 1700 | |
1700 | 1700 |
Needed Data:
Part Number | Column 1 | Column 2 |
1510 | 1510 | |
1510 | 1510 | |
1510 | 1510 | |
1510 | ||
1510 | ||
1510 | ||
1700 | 1700 | |
1700 | 1700 |
Solved! Go to Solution.
Hi,
I am not sure if I understood your logic correctly, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
It is for creating a new table.
expected result table =
VAR _list = VALUES(Data[Column 1])
VAR _t = SELECTCOLUMNS(
Data,
"@part_number", Data[Part Number],
"@column01", Data[Column 1],
"@column02", IF(
NOT (Data[Column 2] IN _list),
Data[Column 2]
)
)
RETURN
_t
Hi,
I am not sure if I understood your logic correctly, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
It is for creating a new table.
expected result table =
VAR _list = VALUES(Data[Column 1])
VAR _t = SELECTCOLUMNS(
Data,
"@part_number", Data[Part Number],
"@column01", Data[Column 1],
"@column02", IF(
NOT (Data[Column 2] IN _list),
Data[Column 2]
)
)
RETURN
_t
非常棒,你帮助了我。
并为我提供了新思路!
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
22 | |
7 | |
6 | |
6 | |
6 |
User | Count |
---|---|
27 | |
10 | |
10 | |
9 | |
6 |