Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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")
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
7 | |
7 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |