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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
vbharakhada
Frequent Visitor

How to get the value of max date from all previous dates except the dates present in the same month

Hi,
I have a table containing the Date, product name, and value.
I need a new column that will contain the value of the maximum date row from all the previous dates.

For example, if the date is 28-03-2023, then the measure will check the max date from all the previous dates except the dates present in the same month i.e. 14-03-2023, and give the value of the max date i.e. 22-02-2023

I have attached the screenshot for reference

vbharakhada_0-1694596540806.png


Regards,

2 REPLIES 2
Ahmedx
Super User
Super User

pls try this

Previous month Max date Value = 
VAR _t1 = 'Table'[Item name]
VAR _tbl = FILTER(ALL('Table'),'Table'[Item name]=_t1)
VAR _Result = CALCULATE(MAX('Table'[Current_Value]),_tbl,PREVIOUSMONTH('Table'[Date]))
RETURN
_Result+0

Screenshot_3.png

Hi  @Ahmedx ,


For me, it's not working as it is taking the max value, instead of the max date's value.
I have attached files please help with that file.

DG_UAE_11_09 - Copy.xlsx
Testing123.pbix

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.