Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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")
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |