Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Find if a text change between different rows

HI Power BI Expert,

 

I'm trying to solve a DAX problerm in Power BI with the following Data:

 

IDSTATUS CODE
100002206
100002205
100002212
100002212
100012855

 

I have a table with two field, "ID" and "STATUS", I would like to find a way to create a calculated column that find if an ID change the Status Code (e.g the Status code in red). I don't mind if the status code is the same, I want to highlight just the different code for the same ID.

 

Any suggestions?

 

Best

  • Anonymous 

    is this what you want?

    Column = 
    VAR _a=maxx(FILTER('Table','Table'[ID]=EARLIER('Table'[ID])&&'Table'[STATUS CODE]<>EARLIER('Table'[STATUS CODE])),'Table'[ID])
    return if(ISBLANK(_a),blank(),"changed")

    if the ID column is text, try this

    Column = 
    VAR _a=maxx(FILTER('Table','Table'[ID]=EARLIER('Table'[ID])&&'Table'[STATUS CODE]<>EARLIER('Table'[STATUS CODE])),'Table'[ID])
    return if(_a=""),blank(),"changed")

3 Replies

  • Anonymous 

    is this what you want?

    Column = 
    VAR _a=maxx(FILTER('Table','Table'[ID]=EARLIER('Table'[ID])&&'Table'[STATUS CODE]<>EARLIER('Table'[STATUS CODE])),'Table'[ID])
    return if(ISBLANK(_a),blank(),"changed")

    if the ID column is text, try this

    Column = 
    VAR _a=maxx(FILTER('Table','Table'[ID]=EARLIER('Table'[ID])&&'Table'[STATUS CODE]<>EARLIER('Table'[STATUS CODE])),'Table'[ID])
    return if(_a=""),blank(),"changed")
  • Anonymous's avatar
    Anonymous
    Not applicable

    Thank you very much, it works!