Forum Discussion
Anonymous
3 years agoNot applicable
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:
| ID | STATUS CODE |
| 10000220 | 6 |
| 10000220 | 5 |
| 10000221 | 2 |
| 10000221 | 2 |
| 10001285 | 5 |
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
- ryan_mayu
Super User
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") - AnonymousNot applicable
Thank you very much, it works!
- ryan_mayu
Super User
you are welcome