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!
I want to compare two consecutive rows in same column using AND function in Power Bi. I managed to do this very easily in Excel. Here is what I did in Excel: B2 = AND (A1 = 0; A2 = 1). To sum up, I have a column with 1 and 0. I want to identify all the 1 that come after a 0. Here is an example of what it should look like:
| A | B | |
| 1 | 0 | |
| 2 | 0 | FAUX |
| 3 | 1 | VRAI |
| 4 | 1 | FAUX |
| 5 | 1 | FAUX |
| 6 | 1 | FAUX |
| 7 | 0 | FAUX |
| 8 | 0 | FAUX |
| 9 | 1 | VRAI |
| 10 | 1 | FAUX |
| 11 | 0 | FAUX |
I feel like it's simple, but I don't know Power BI well enough. Maybe I need to think it in another way?
Thanks for your help!
Solved! Go to Solution.
@gsanterre , Make sure you have an index column or add a new column given below
https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi
if([index] =1 && maxx(filter(Table,[index] =earlier([index])-1 && [index] =0),[index]) , "VRAI", "FAUX")
@gsanterre , Make sure you have an index column or add a new column given below
https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi
if([index] =1 && maxx(filter(Table,[index] =earlier([index])-1 && [index] =0),[index]) , "VRAI", "FAUX")
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 56 | |
| 42 | |
| 41 | |
| 20 | |
| 19 |