Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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")
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.