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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Measure for last registred date in previous months

Hi,

 

I need help with a measure that gives me the value of the last date in the two previous months.

As today is 24/11/2021 I need one measure that gives me 29/10/2021 and one that gives med 28/09/2021... The last date vary from month to month, but I always need the last previous and last two months ago

 

bareanders84_0-1637756102898.png

 

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , with help from a date table

 

measure =
var _max = eomonth(today() ,-1)
var _min = eomonth(today(),-3)+1
return
calculate(lastnonblankvalue('Date'[Date], [Measure]), filter(all('Date'), 'Date'[Date]>= _min && 'Date'[Date]<= _max && 'Date'[Month year] = max('Date'[Month Year])))

Anonymous
Not applicable

Hi,

 

Thanks you for your reply.

I might have been a bit unclear, but I need two measures, one for last date in previous and one for last date two months back. Which one have you written?

And I can't use [Measure]...that would be a circular reference

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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