Forum Discussion

gsanterre's avatar
gsanterre
New Member
5 years ago
Solved

Comparison between two consecutive rows in the same column

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:

 

 AB
10 
20FAUX
31VRAI
41FAUX
51FAUX
61FAUX
70FAUX
80FAUX
91VRAI
101FAUX
110FAUX

 

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!