Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Werfuks
Frequent Visitor

How to get the Previous Month Value

Hi Community, I'm trying to get the value from the previous month in the following table, which is about trying to see if there was a change in the employee status (employee is "active" or "on leave"). Does anyone know how to get it? I already found some ideas in older chats but I didn't manage to make it work.

 

Thank you in advance!

 

Month/YearEmployee IDStatusStatus PRV Month
30.06.20241188On Leave 
30.06.20241066On Leave 
30.06.20241100Active 
30.06.2024900Active 
30.06.20241155Active 
30.06.20241245Active 
30.06.20241056Active 
31.07.20241188ActiveOn Leave
31.07.20241066ActiveOn Leave
31.07.20241100On LeaveActive
31.07.2024900ActiveActive
31.07.20241155ActiveActive
31.07.20241245ActiveActive
31.07.20241056ActiveActive
31.08.20241188ActiveActive
31.08.20241066ActiveActive
31.08.20241100On LeaveOn Leave
31.08.2024900ActiveActive
31.08.20241155ActiveActive
31.08.20241245On LeaveActive
31.08.20241056ActiveActive

 

I already tried this without success:

Measure1:

Date = DATEADD(Basisdaten_Headcount[Month/Year],-1,MONTH)

 Measure2:

PRV Status =
VAR __Date = [Date]
VAR __PreviousDate = MAXX( FILTER(Basisdaten_Headcount,[Employee ID] = [Employee ID] && [Date] < __Date),[Date])
VAR __PreviousStatus = MAXX( FILTER(Basisdaten_Headcount,[Employee ID] = [Employee ID] && [Date] = __Date), [Currently Active])
RETURN
__PreviousStatus
1 ACCEPTED SOLUTION
ThxAlot
Super User
Super User

ThxAlot_0-1725474940419.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



View solution in original post

3 REPLIES 3
ThxAlot
Super User
Super User

ThxAlot_0-1725474940419.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



mark_endicott
Super User
Super User

@Werfuks - It looks like you have not created a date table, which is essential for doing time intelligence calculations. You can build a simple one using CALENDARAUTO() when creating a calculated table. There is also a great video of options here: https://www.youtube.com/watch?v=WybnTHDl-AM

 

Once you have done this, make sure you create a relationship between your new date table date column and the date column in your Basisdaten_Headcount table. 

 

You can then use the following DAX to create the measure - you will need to change names to suit your model:

 

 

CALCULATE( [Measure], DATEADD('Date Table'[Date Column],-1,MONTH)

 

 

If this works for you, pelase accept it as the solution for others - it helps with visibility.

mark_endicott
Super User
Super User

@Werfuks - It looks like you have not created a date table, which is essential for doing time intelligence calculations. You can build a simple one using CALENDARAUTO() when creating a calculated table. There is also a great video of options here: https://www.youtube.com/watch?v=WybnTHDl-AM

 

Once you have done this, make sure you create a relationship between your new date table date column and the date column in your Basisdaten_Headcount table. 

 

You can then use the following DAX to create the measure - you will need to change names to suit your model:

 

CALCULATE( [Measure], DATEADD('Date Table'[Date Column],-1,MONTH)

 

If this works for you, pelase accept it as the solution for others - it helps with visibility.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.