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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors