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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hello,
I want to compare Code which is Text with previous month. Each code can come is unique like in January this code can only comes one not more than that. Same code can come in next month but it can only come only once there as well.
My tale looks like below:
Month | Code |
March | 112 |
March | 123 |
April | 866 |
April | 112 |
May | 656 |
May | 234 |
I want to create a new column and comapre these codes with previous month. If For example code 112 in April is also in previous month then the value against it should be like unchanged. If the codeis not in previous month then it should show new else it should show gone. I am attaching a outcome table as well along with the criteria.
Month | Code | Outcome |
March | 112 | GONE |
March | 123 | GONE |
April | 866 | NEW |
April | 112 | UNCHANGED |
May | 656 | NEW |
May | 234 | NEW |
If Exist in March and April: 'Unchanged'
If Exist in March Not Exist April: 'Gone'
if don't exist in march and exist in April: 'New"
It would be highly appreciated if I can get the response.
Thank you
@Junaid11 , Try like
New column =
var _date = [Date]
var _code = maxx(filter(Table,eomonth(_date,0) = eomonth([Date],0) ),[Code])
return
Switch(True(),
[Code] = _code, "Unchanged",
Not(isblank(_code)) && [Code]<> _code, "New" , "Gone")
Hello @amitchandak ,
The code is not working I am getting below outcome which is not similar to outocme I have mentioned.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.