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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
windylee
Frequent Visitor

How to show look up a value of the previous month

Here is my data table:

 

Buyer IDBuyer NameCredit Limit ($)File Date
001ABC20002024-01
001ABC10002023-12
001ABC10002023-11
002DEF50002024-01
003GHI40002023-12
003GHI35002023-11

 

I want to add a column to get the credit limit of last month of File Date, so that the new table will be:

 

Buyer IDBuyer NameCredit Limit ($)File DateLast Month Credit Limit($)
001ABC20002024-011000
001ABC10002023-129000
001ABC9002023-11 
002DEF50002024-01 
003GHI40002023-123500
003GHI35002023-11 

 

Could you please teach me what DAX I can use in order to get the new column?

I tried to create a new column to show Last File Date using PREVIOUSMONTH, then add another column to get the limit by using LOOKUPVALUE, but there are circular dependencies detected.

Please help! Thank you very much!

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@windylee 

make sure the file date is in date type and create a column

 

Column = maxx(FILTER('Table','Table'[Buyer ID]=EARLIER('Table'[Buyer ID])&&'Table'[File Date]=EDATE(EARLIER('Table'[File Date]),-1)),'Table'[Credit Limit ($)])
11.PNG




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

Proud to be a Super User!




View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

@windylee 

make sure the file date is in date type and create a column

 

Column = maxx(FILTER('Table','Table'[Buyer ID]=EARLIER('Table'[Buyer ID])&&'Table'[File Date]=EDATE(EARLIER('Table'[File Date]),-1)),'Table'[Credit Limit ($)])
11.PNG




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

Proud to be a Super User!




Thank you so much!! I successfully added the desired column!

you are welcome





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

Proud to be a Super User!




Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.