Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello
Could someone help me with a calculated column to record a fact table, if two columns are equal then 1, but if they have already existed once then 0 as in the image below in the output column.
Duplicate deletion cannot occur, as these are rows of data with more columns.
Row 1 | Row 2 | exit |
1 | 1 | 1 |
2 | 2 | 1 |
2 | 2 | 0 |
3 | 3 | 1 |
2 | 2 | 0 |
Thank you
Liam
Solved! Go to Solution.
Hi @Anonymous
You can add Index in Power Query or use an existing if you have one, and later add the column as per below.
Column =
VAR __row1 = 'Table'[Row 1]
VAR __index = 'Table'[Index]
RETURN
INT(
IF(
__row1 = 'Table'[Row 2],
COUNTROWS(
FILTER(
'Table',
'Table'[Index] < __index
&& 'Table'[Row 1] = __row1
&& 'Table'[Row 2] = __row1
)
) = 0
)
)
The result will be
Hi @Anonymous
You can add Index in Power Query or use an existing if you have one, and later add the column as per below.
Column =
VAR __row1 = 'Table'[Row 1]
VAR __index = 'Table'[Index]
RETURN
INT(
IF(
__row1 = 'Table'[Row 2],
COUNTROWS(
FILTER(
'Table',
'Table'[Index] < __index
&& 'Table'[Row 1] = __row1
&& 'Table'[Row 2] = __row1
)
) = 0
)
)
The result will be
@Anonymous , if logic is based row1 and row 2, it is not very clear
Hi @amitchandak ,
I just needed the system to pick up on a match and if its already happened somehow,
I dont know whether thats possible
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
84 | |
67 | |
60 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |