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!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi All,
Need help for the below sample dataset. In excel we use the IF cond "=IF(A2=A1,0,1)"to retrive the Output.
Kindly let me know how can i get the same using DAX (Column) in Power BI.
Supplier Key : Dataset
Output required : Desired Output
| Suplier Key | Output required |
| 4D2B1234567 - Supplier - 1 | 1 |
| 4D2B1234567 - Supplier - 1 | 0 |
| 4D2B1234567 - Supplier - 1 | 0 |
| 4D2B1234567 - Supplier - 1 | 0 |
| 4D2B1234567 - Supplier - 1 | 0 |
| 4D2B1234567 - Supplier - 1 | 0 |
| 4D2B1234567 - Supplier - 1 | 0 |
| 4D2B1234567 - Supplier - 1 | 0 |
| 884B1234567 - Supplier - 1 | 1 |
| 884B1234567 - Supplier - 1 | 0 |
| 884B1234567 - Supplier - 1 | 0 |
| 4D2B1234567 - Supplier - 1 | 1 |
| 4D2B1234567 - Supplier - 1 | 0 |
| 4D2B1234567 - Supplier - 1 | 0 |
| 4D2B1234567 - Supplier - 1 | 0 |
| 4D2B1234567 - Supplier - 1 | 0 |
| 4D2B1234567 - Supplier - 2 | 1 |
| 4D2B1234567 - Supplier - 2 | 0 |
| T01B1234567 - Supplier - 3 | 1 |
| 661B1234567 - Supplier - 4 | 1 |
| 462B1234567 - Supplier - 5 | 1 |
| 477B1234567 - Supplier - 6 | 1 |
| 430B1234567 - Supplier - 7 | 1 |
| 477B1234567 - Supplier - 8 | 1 |
| 4A5B1234567 - Supplier - 9 | 1 |
| 4A5B1234567 - Supplier - 9 | 0 |
| 4A5B1234567 - Supplier - 9 | 0 |
| 4A5B1234567 - Supplier - 9 | 0 |
| 4A5B1234567 - Supplier - 9 | 0 |
| 4A5B1234567 - Supplier - 9 | 0 |
| 4A5B1234567 - Supplier - 9 | 0 |
| 4A5B1234567 - Supplier - 9 | 0 |
| 4A5B1234567 - Supplier - 9 | 0 |
| 4A5B1234567 - Supplier - 9 | 0 |
| 4A5B1234567 - Supplier - 9 | 0 |
| 4A5B1234567 - Supplier - 9 | 0 |
| 4A5B1234567 - Supplier - 9 | 0 |
| 4A5B1234567 - Supplier - 9 | 0 |
| 4A5B1234567 - Supplier - 9 | 0 |
| 4A5B1234567 - Supplier - 9 | 0 |
| 304B1234567 - Supplier - 10 | 1 |
| 4A5B1234567 - Supplier - 11 | 1 |
| 4A5B1234567 - Supplier - 11 | 0 |
| 4A5B1234567 - Supplier - 11 | 0 |
| 4A5B1234567 - Supplier - 11 | 0 |
| 4A5B1234567 - Supplier - 11 | 0 |
| 4A5B1234567 - Supplier - 11 | 0 |
| 4A5B1234567 - Supplier - 11 | 0 |
| 4A5B1234567 - Supplier - 11 | 0 |
| 4A5B1234567 - Supplier - 11 | 0 |
| 4A5B1234567 - Supplier - 11 | 0 |
| 4A5B1234567 - Supplier - 11 | 0 |
| 4A5B1234567 - Supplier - 11 | 0 |
| 4A5B1234567 - Supplier - 11 | 0 |
| 4A5B1234567 - Supplier - 11 | 0 |
| 4A5B1234567 - Supplier - 11 | 0 |
| 4A5B1234567 - Supplier - 11 | 0 |
| T01B1234567 - Supplier - 12 | 1 |
| T01B1234567 - Supplier - 12 | 0 |
| T01B1234567 - Supplier - 12 | 0 |
| T01B1234567 - Supplier - 12 | 0 |
| T01B1234567 - Supplier - 12 | 0 |
| T01B1234567 - Supplier - 12 | 0 |
| 430B1234567 - Supplier - 13 | 1 |
| 430B1234567 - Supplier - 13 | 0 |
| T01B1234567 - Supplier - 14 | 1 |
| 468B1234567 - Supplier - 15 | 1 |
| 468B1234567 - Supplier - 15 | 0 |
| 468B1234567 - Supplier - 15 | 0 |
| 468B1234567 - Supplier - 15 | 0 |
| 468B1234567 - Supplier - 15 | 0 |
| 889B1234567 - Supplier - 16 | 1 |
| 889B1234567 - Supplier - 16 | 0 |
| 889B1234567 - Supplier - 16 | 0 |
| T01B1234567 - Supplier - 17 | 1 |
| 468B1234567 - Supplier - 18 | 1 |
| 304B1234567 - Supplier - 19 | 1 |
| 304B1234567 - Supplier - 19 | 0 |
| 614B1234567 - Supplier - 20 | 1 |
| 614B1234567 - Supplier - 20 | 0 |
| 614B1234567 - Supplier - 20 | 0 |
| 614B1234567 - Supplier - 20 | 0 |
| 614B1234567 - Supplier - 20 | 0 |
| 614B1234567 - Supplier - 20 | 0 |
| 430B1234567 - Supplier - 21 | 1 |
| 430B1234567 - Supplier - 21 | 0 |
| 468B1234567 - Supplier 1 | 1 |
| 4H8B1234567 - Supplier 2 | 1 |
| 4H8B1234567 - Supplier 2 | 0 |
| 606B1234567 - Supplier 3 | 1 |
| 606B1234567 - Supplier 3 | 0 |
| 606B1234567 - Supplier 3 | 0 |
| 606B1234567 - Supplier 3 | 0 |
| 606B1234567 - Supplier 3 | 0 |
| 606B1234567 - Supplier 3 | 0 |
| 606B1234567 - Supplier 3 | 0 |
| 606B1234567 - Supplier 3 | 0 |
| 606B1234567 - Supplier 3 | 0 |
| 606B1234567 - Supplier 3 | 0 |
| 606B1234567 - Supplier 3 | 0 |
| 606B1234567 - Supplier 3 | 0 |
| 606B1234567 - Supplier 3 | 0 |
| 606B1234567 - Supplier 3 | 0 |
| 606B1234567 - Supplier 3 | 0 |
| 606B1234567 - Supplier 3 | 0 |
| 606B1234567 - Supplier 3 | 0 |
| 468B1234567 - Supplier 4 | 1 |
| 456B1234567 - Supplier 5 | 1 |
| 468B1234567 - Supplier 6 | 1 |
| 525B1234567 - Supplier 7 | 1 |
| 468B1234567 - Supplier 8 | 1 |
| 468B1234567 - Supplier 8 | 0 |
| 468B1234567 - Supplier 8 | 0 |
| 468B1234567 - Supplier 8 | 0 |
| 468B1234567 - Supplier 8 | 0 |
| 456B1234567 - Supplier 9 | 1 |
| 472B1234567 - Supplier 10 | 1 |
| 472B1234567 - Supplier 10 | 0 |
| 472B1234567 - Supplier 10 | 0 |
| T01B1234567 - Supplier 11 | 1 |
| T01B1234567 - Supplier 11 | 0 |
| T01B1234567 - Supplier 11 | 0 |
| 456B1234567 - Supplier 12 | 1 |
| T01B1234567 - Supplier 13 | 1 |
| 4H8B1234567 - Supplier 14 | 1 |
| 4H8B1234567 - Supplier 14 | 0 |
| 4H8B1234567 - Supplier 14 | 0 |
| 4H8B1234567 - Supplier 14 | 0 |
| 4H8B1234567 - Supplier 14 | 0 |
| 4H8B1234567 - Supplier 14 | 0 |
Thanks
Allwin
Solved! Go to Solution.
@Anonymous add index column in your table in power query to find our previous row and then you can use that to calcuate the desired output
Match = VAR __prevRow = CALCULATE( MAX( 'Table'[Index] ) ) - 1 VAR __PrevRowValue = CALCULATE( MAX( 'Table'[Suplier Key] ), 'Table'[Index] = __prevRow ) VAR __currRowValue = CALCULATE( MAX( 'Table'[Suplier Key] ) ) RETURN IF( __currRowValue = __PrevRowValue, 0, 1 )
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Anonymous add index column in your table in power query to find our previous row and then you can use that to calcuate the desired output
Match = VAR __prevRow = CALCULATE( MAX( 'Table'[Index] ) ) - 1 VAR __PrevRowValue = CALCULATE( MAX( 'Table'[Suplier Key] ), 'Table'[Index] = __prevRow ) VAR __currRowValue = CALCULATE( MAX( 'Table'[Suplier Key] ) ) RETURN IF( __currRowValue = __PrevRowValue, 0, 1 )
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 53 | |
| 47 | |
| 30 | |
| 15 | |
| 14 |
| User | Count |
|---|---|
| 88 | |
| 73 | |
| 39 | |
| 26 | |
| 24 |