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
Hi,
Would somebody please be able to help me with a calculated column to check in a fact table, if two columns are the same then 1, but if they have already existed once then 0 like in the image below in the output column.
Deleting duplicates can't happen as these are rows of data with more columns.
| Row 1 | Row 2 | Output |
| 1 | 1 | 1 |
| 2 | 2 | 1 |
| 2 | 2 | 0 |
| 3 | 3 | 1 |
| 2 | 2 | 0 |
Thanks
Liam
Solved! Go to Solution.
You would need an Index column for that to define "before". If you had that you could do this:
Column =
VAR __Table = FILTER('Table',[Row 1] = EARLIER([Row 1]) && [Row 2] = EARLIER([Row 2]) && [Index] < EARLIER([Index])
RETURN
IF(COUNTROWS(__Table) > 0,0,1)
You would need an Index column for that to define "before". If you had that you could do this:
Column =
VAR __Table = FILTER('Table',[Row 1] = EARLIER([Row 1]) && [Row 2] = EARLIER([Row 2]) && [Index] < EARLIER([Index])
RETURN
IF(COUNTROWS(__Table) > 0,0,1)
Hi @Greg_Deckler ,
Thankyou for your reply! The formula says the syntax for RETURN in incorrect currently
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 35 | |
| 34 | |
| 32 | |
| 27 |
| User | Count |
|---|---|
| 136 | |
| 96 | |
| 77 | |
| 67 | |
| 65 |