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 dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi
I would like to know the DAX command to determine if the next row has the same value as the current row. Can you please help me out? I have provided an example for better explanation
Example:
Solved! Go to Solution.
@Jo5hua22 , A new column
var _seq = [S.No]
var _last = countx(filter(Table, Table[S.No] = _seq -1 && [KPI] = "R"),[S.No])
var _Next = countx(filter(Table, Table[S.No] = _seq +1 && [KPI] = "R"),[S.No])
return
Switch(True() ,
[KPI] = "R" && isblank(_last) && isblank(_next) , "No Check",
[KPI] = "R" && not(isblank(_last)) && isblank(_next) , "Check",
blank())
Hi @Jo5hua22
This calculated column should work:
Output =
IF (
NOT ISBLANK ( Table[KPI] ),
IF (
NOT ISBLANK ( LOOKUPVALUE ( Table[KPI], Table[S.No], Table[S.No] - 1 ) ),
"Check"
)
)
If ok, please consider marking my reply as accepted. Thank you!
Hi @Jo5hua22
This calculated column should work:
Output =
IF (
NOT ISBLANK ( Table[KPI] ),
IF (
NOT ISBLANK ( LOOKUPVALUE ( Table[KPI], Table[S.No], Table[S.No] - 1 ) ),
"Check"
)
)
If ok, please consider marking my reply as accepted. Thank you!
@Jo5hua22 , A new column
var _seq = [S.No]
var _last = countx(filter(Table, Table[S.No] = _seq -1 && [KPI] = "R"),[S.No])
var _Next = countx(filter(Table, Table[S.No] = _seq +1 && [KPI] = "R"),[S.No])
return
Switch(True() ,
[KPI] = "R" && isblank(_last) && isblank(_next) , "No Check",
[KPI] = "R" && not(isblank(_last)) && isblank(_next) , "Check",
blank())
Hi @amitchandak
I tried your code but I am getting blank columns as the output. Can you share the pbi file that you did?
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
15 | |
9 | |
7 | |
7 | |
6 |
User | Count |
---|---|
22 | |
11 | |
10 | |
10 | |
8 |