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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
KSPG
Regular Visitor

Need help to get DAX to pull latest message based on the date included in the message

attached data sample here

ColumnA
10/5/2022 5:35:52 PM, abcdefghijklmnopqrstuvwxyz
10/2/2022 9:41:39 PM, abcdefghijklmnopqrstuvwxyz
9/23/2022 6:35:33 PM, abcdefghijklmnopqrstuvwxyz
9/22/2022 10:39:04 PM, abcdefghijklmnopqrstuvwxyz
9/22/2022 10:38:49 PM, abcdefghijklmnopqrstuvwxyz
9/22/2022 6:34:23 PM, abcdefghijklmnopqrstuvwxyz
9/22/2022 6:00:00 PM, abcdefghijklmnopqrstuvwxyz
9/3/2022 4:32:16 PM, abcdefghijklmnopqrstuvwxyz
8/22/2022 6:16:21 PM, abcdefghijklmnopqrstuvwxyz
 
10/5/2022 5:35:52 PM, abcdefghijklmnopqrstuvwxyz
10/2/2022 9:41:39 PM, abcdefghijklmnopqrstuvwxyz
9/23/2022 6:35:33 PM, abcdefghijklmnopqrstuvwxyz
9/22/2022 10:39:04 PM, abcdefghijklmnopqrstuvwxyz
9/22/2022 10:38:49 PM, abcdefghijklmnopqrstuvwxyz
9/22/2022 6:34:23 PM, abcdefghijklmnopqrstuvwxyz
9/22/2022 6:00:00 PM, abcdefghijklmnopqrstuvwxyz
9/3/2022 4:32:16 PM, abcdefghijklmnopqrstuvwxyz
8/22/2022 6:16:21 PM, abcdefghijklmnopqrstuvwxyz
4/18/2022 7:00:00 PM, abcdefghijklmnopqrstuvwxyz
1 ACCEPTED SOLUTION
Shaurya
Memorable Member
Memorable Member

Hi @KSPG,

 

Even though this can be a lot simpler task in Power Query, since you have asked in DAX, here you go. Create two new columns, one for Date and another for Text based on the position of the comma.

 

Date = LEFT('Table'[Message],SEARCH(",",'Table'[Message])-1)

 

Text = MID('Table'[Message],SEARCH(",",'Table'[Message])+2,LEN('Table'[Message]))

 

Now create this measure and add it in a card visual:

 

Latest Message = CALCULATE(MAX('Table'[Text]),FILTER('Table','Table'[Date]=MAX('Table'[Date])))

 

Works for you? Mark this post as a solution if it does!
Consider taking a look at my blog: Forecast Period - Graphical Comparison 

View solution in original post

1 REPLY 1
Shaurya
Memorable Member
Memorable Member

Hi @KSPG,

 

Even though this can be a lot simpler task in Power Query, since you have asked in DAX, here you go. Create two new columns, one for Date and another for Text based on the position of the comma.

 

Date = LEFT('Table'[Message],SEARCH(",",'Table'[Message])-1)

 

Text = MID('Table'[Message],SEARCH(",",'Table'[Message])+2,LEN('Table'[Message]))

 

Now create this measure and add it in a card visual:

 

Latest Message = CALCULATE(MAX('Table'[Text]),FILTER('Table','Table'[Date]=MAX('Table'[Date])))

 

Works for you? Mark this post as a solution if it does!
Consider taking a look at my blog: Forecast Period - Graphical Comparison 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.