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!View all the Fabric Data Days sessions on demand. View schedule
Hi everyone,
i have a snapshot table (same employees every month in a single table) and i need to compare job_id for an employee from previous month
i would like to create a calculated column or measure (job_id_previous_month) like this :
| employee_id | job_id | snapshot_date | job_id_previous_month |
| E001 | J123 | 31/01/2024 | |
| E002 | J230 | 31/01/2024 | |
| E003 | J230 | 31/01/2024 | |
| E001 | J235 | 28/02/2024 | J123 |
| E002 | J230 | 28/02/2024 | J230 |
| E003 | J230 | 28/02/2024 | J230 |
Any help to do this ?
Thanks
Solved! Go to Solution.
Hi,
Please check the below picture and the attached pbix file.
job_id_previous_month CC =
VAR _currentrowemployee = data[employee_id]
VAR _currentrowmonth = data[snapshot_date]
RETURN
MAXX (
FILTER (
data,
data[employee_id] = _currentrowemployee
&& data[snapshot_date] = EOMONTH ( _currentrowmonth, -1 )
),
data[job_id]
)
Expertise = List.Accumulate( {Days as from Today}, {Skills and Knowledge}, (Current, Everyday) => Current & Day.LearnAndPractise(Everyday) ) |
Hello @coollehavre ,
Please try the below code..
job_id_previous_month =
VAR currentEmployee = 'Table'[employee_id]
VAR currentDate = 'Table'[snapshot_date]
RETURN
CALCULATE(MAX('Table'[job_id]),FILTER('Table','Table'[employee_id] = currentEmployee &&
EOMONTH('Table'[snapshot_date], 0) = EOMONTH(currentDate, -1)))
If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes are much appreciated!
Thank You
Dharmendar S
Hello @coollehavre ,
Please try the below code..
job_id_previous_month =
VAR currentEmployee = 'Table'[employee_id]
VAR currentDate = 'Table'[snapshot_date]
RETURN
CALCULATE(MAX('Table'[job_id]),FILTER('Table','Table'[employee_id] = currentEmployee &&
EOMONTH('Table'[snapshot_date], 0) = EOMONTH(currentDate, -1)))
If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes are much appreciated!
Thank You
Dharmendar S
Hi,
Please check the below picture and the attached pbix file.
job_id_previous_month CC =
VAR _currentrowemployee = data[employee_id]
VAR _currentrowmonth = data[snapshot_date]
RETURN
MAXX (
FILTER (
data,
data[employee_id] = _currentrowemployee
&& data[snapshot_date] = EOMONTH ( _currentrowmonth, -1 )
),
data[job_id]
)
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 |
|---|---|
| 13 | |
| 11 | |
| 9 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 28 | |
| 20 | |
| 20 | |
| 19 | |
| 12 |