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
I want to create a code that can detect one statement true but the other is false and not sure how to write it in DAX. I would like it to flag in a new colomn where address no. is the same but the post code is not the same.
For example
| Current Data | ||
| Address No. | Post Code | |
| 13334 | 124 | |
| 13334 | 123 | |
| 54899 | 124 | |
| 56465 | 111 | |
| 46546 | 234 | |
| 46546 | 234 | |
| Result | ||
| Address No. | Post Code | Test |
| 13334 | 124 | Yes |
| 13334 | 123 | Yes |
| 54899 | 124 | No |
| 56465 | 111 | No |
| 46546 | 234 | No |
| 46546 | 234 | No |
| 13334 | 111 | Yes |
Solved! Go to Solution.
@Anonymous , Create a new column like
New column =
var _cnt = calculate(distinctcount(Table[ Post Code]), filter(Table,[Address No] = earlier(Table[Address No])))
return
if(_cnt >1 , "Yes", "No")
@Anonymous , Create a new column like
New column =
var _cnt = calculate(distinctcount(Table[ Post Code]), filter(Table,[Address No] = earlier(Table[Address No])))
return
if(_cnt >1 , "Yes", "No")
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 20 | |
| 11 | |
| 10 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 34 | |
| 31 | |
| 19 | |
| 12 | |
| 11 |