Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I need to filter my visual to only show rows where there has been a change in "Attribute" compared to the previous row.
We start with our dataset:
| Index | Attribute |
| 1 | A |
| 2 | A |
| 3 | B |
| 4 | B |
| 5 | C |
I imagine the solution would be to build a calculated column with DAX called "Changed". Value 1 for all rows where the there has been a change compared to the previous row, 0 when there has been no change.
| Index | Attribute | Changed |
| 1 | A | 1 |
| 2 | A | 0 |
| 3 | B | 1 |
| 4 | B | 1 |
| 5 | C | 1 |
| 6 | C | 0 |
Row 1 would ideally also have value 1 as it's the base value and I would like to include in the the visual.
Could somebody point me to the right direction for building th calculated column?
Thank you!
Solved! Go to Solution.
@Anonymous
Column =
VAR _prevattr = CALCULATE(MAX('Table'[Attribute]),FILTER('Table','Table'[Index]<EARLIER('Table'[Index])))
RETURN IF('Table'[Attribute]<>_prevattr,1,0)
Please use this formula to track status change. However one thing I didn't get for index 4 changed value column value is 1 I think it should be 0. Let me know if you have question
Thanks for providing a dataset that could be copied and pasted.
Here's the measure I wrote
Help when you know. Ask when you don't!
Thanks for providing a dataset that could be copied and pasted.
Here's the measure I wrote
Help when you know. Ask when you don't!
@Anonymous
Column =
VAR _prevattr = CALCULATE(MAX('Table'[Attribute]),FILTER('Table','Table'[Index]<EARLIER('Table'[Index])))
RETURN IF('Table'[Attribute]<>_prevattr,1,0)
Please use this formula to track status change. However one thing I didn't get for index 4 changed value column value is 1 I think it should be 0. Let me know if you have question
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 58 | |
| 43 | |
| 41 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 121 | |
| 96 | |
| 65 | |
| 46 |