Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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?
@Jo5hua22 ,
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.