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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

Create new column with last month's value for a given category

I want to create a new column that consists of the previous month's value for a given Category.

For example, if the data I'm given is as follows:

MonthCategoryPrice
1/1/2024Car1000
1/1/2024House2000
2/1/2024Car900
2/1/2024House2000
2/1/2024Insurance600
3/1/2024Car800
3/1/2024House2000
4/1/2024Car700
4/1/2024House2000
5/1/2024House2500
6/1/2024Car600
6/1/2024House2000

 

I would want the new column to look like this:

MonthCategoryPricePrevious Month Value
1/1/2024Car1000 
1/1/2024House2000 
2/1/2024Car9001000
2/1/2024House20002000
2/1/2024Insurance600 
3/1/2024Car800900
3/1/2024House20002000
4/1/2024Car700800
4/1/2024House20002000
5/1/2024House25002000
6/1/2024Car600 
6/1/2024House2000

2500

 

If there is no data for the previous month for the given category, the "Previous Month Value" should be null.

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@Anonymous 

 

Column = maxx(FILTER('Table','Table'[Category]=EARLIER('Table'[Category])&& 'Table'[Month]=EDATE(EARLIER('Table'[Month]),-1)),'Table'[Price])
 
11.PNG




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
ryan_mayu
Super User
Super User

@Anonymous 

 

Column = maxx(FILTER('Table','Table'[Category]=EARLIER('Table'[Category])&& 'Table'[Month]=EDATE(EARLIER('Table'[Month]),-1)),'Table'[Price])
 
11.PNG




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.