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 September 15. Request your voucher.

Reply
Karolina411
Helper V
Helper V

filtering by both MAX date and a substring in the column

Hello! How can I write a DAX formula that contains the MAX date and only finds that MAX date whene the Name Column contains certain words in it? Below I want the Max date of the Name which Contains 'Membership' etc.

Karolina411_0-1699406423241.png

 

6 REPLIES 6
Karolina411
Helper V
Helper V

Karolina411_0-1699455448021.png

If you look above the goal is to id the files by a name in the filename then show it's MAX date inside the report.

 

Karolina411
Helper V
Helper V

Thank you @amitchandak but I want to = a substring as it is a work w/i the file name I wish to identify. Like this but using a substring: Calculate(max(Table [DateOfInstallment]),FILTER(Table, Table [linkedgift_id]=[id]))

Ashish_Mathur
Super User
Super User

Hi,

You are showing the Query Editor window and requesting for a DAX formula.  DAX is the formula language of the Data Model (not the Query Editor).  Share data in a format that can be pasted in an MS Excel file and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@Karolina411 , You can use List.Max to get max Date 

 

Step0 = <You current Table code>

Step1 = List.Max(Table.SelectRows(Step0, each Text.Contains( Name], "Membership") ) [Date Modified])

Step2 = Table.SelectRows(Step0, each Text.Contains( Name], "Membership") and [Date Modified] = _max)

in

Step2

 

In case you need measure based approch

 

Latest
https://amitchandak.medium.com/power-bi-get-the-last-latest-value-of-a-category-d0cf2fcf92d0

https://amitchandak.medium.com/power-bi-get-the-sum-of-the-last-latest-value-of-a-category-f1c839ee8...

 

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

Is this a calucalted columns?  Where does this go?  Is <current Table code.> the name of the table???

 

Step0 = <You current Table code>

Step1 = List.Max(Table.SelectRows(Step0, each Text.Contains( Name], "Membership") ) [Date Modified])

Step2 = Table.SelectRows(Step0, each Text.Contains( Name], "Membership") and [Date Modified] = _max)

in

Step2

Thank you but I am thinking a measure like this but it is not working (giving a blank)

Meridian Membership = CALCULATE(Max(JHNMeridian[Date created]),FILTER(JHNMeridian, JHNMeridian[Name] in {"Membership"}))

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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