Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 July 2025 Power BI update to learn about new features.
User | Count |
---|---|
70 | |
70 | |
38 | |
28 | |
26 |
User | Count |
---|---|
97 | |
88 | |
59 | |
43 | |
40 |