Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
Hi,
I would like to know how to create a new column where I get the value "New" if a person exists in previous months of my data and "Old" if it exists in previous months or if it's the first month of data.
I have a table like this:
| Date | Person |
| 15/11/2021 | A |
| 13/11/2021 | A |
| 12/11/2021 | B |
| 10/11/2021 | C |
| 20/10/2021 | A |
| 15/10/2021 | C |
| 10/10/2021 | C |
| 15/09/2021 | A |
Take into account that individuals may appear more than once on a month, so this is what I would like:
| Date | Person | Column |
| 15/11/2021 | A | Old |
| 13/11/2021 | A | Old |
| 12/11/2021 | B | New |
| 10/11/2021 | C | Old |
| 20/10/2021 | A | Old |
| 15/10/2021 | C | New |
| 10/10/2021 | C | New |
| 15/09/2021 | A | New |
Thanks in advance!
Solved! Go to Solution.
a new column =
var _1 = countx(filter(Table, [Person] = earlier([Person]) && [Date] < earlier([Date] ) ), [Person]) +0
return
if(_1 > 0, "Old", "New")
and if I want to check if it is NEW or OLD but only in last 5 weeks? So the range of date is 5 weeks before [Date]?
a new column =
var _1 = countx(filter(Table, [Person] = earlier([Person]) && [Date] < earlier([Date] ) ), [Person]) +0
return
if(_1 > 0, "Old", "New")
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 23 | |
| 23 | |
| 20 | |
| 18 | |
| 14 |
| User | Count |
|---|---|
| 58 | |
| 53 | |
| 42 | |
| 30 | |
| 24 |