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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
SErgey-kuznetso
Frequent Visitor

Insert previous value

How can I use DAX formula to insert values from previous months?

 

Example: There is a table http://prntscr.com/qufdjt it is necessary that the value of the Steps is rolled in the current month from the previous one, thereby making it possible to compare these two indicators.

1 ACCEPTED SOLUTION

You need to add more conditions like Region

Example

Last Month column = minx(FILTER('Date','Date'[Date]=EARLIER('Date'[Prev Month Value]) && 'Date'[Region]= earlier('Date'[Region])),'Date'[Month-Year]) 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

I did it two steps. In two columns

First columns get the date that corresponds to the date this month, Second brings the content

 

Prev Month Value = dateadd('Date'[Date],-1,MONTH)
Last Month column = minx(FILTER('Date','Date'[Date]=EARLIER('Date'[Prev Month Value])),'Date'[Month-Year]) 

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak 

Ok! First step helped me to figure out Prev_Month_Value but due to the function MINX it insert the minimal value from previous month.

 

There are many repeated Regions with different values of the Steps and I need to insert the Previous Value of the Region from Last Month in current.


Here another example of table http://prntscr.com/qugxns 

You need to add more conditions like Region

Example

Last Month column = minx(FILTER('Date','Date'[Date]=EARLIER('Date'[Prev Month Value]) && 'Date'[Region]= earlier('Date'[Region])),'Date'[Month-Year]) 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak 

Thanks, It works! I really appreciate your help

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.