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
AW1976NOVA
Post Patron
Post Patron

LOOKUPVALUE selecting the min value of a date

Hi, 

 

I'm trying to do a LOOKUPVALUE formula, but I need to return only the lowest value.  But I can't get it to work (normal LOOKUPVALUE returns errors, given that it matches multiple values).

 

Background

I'm working with medical data, and I've got two tables of data.  Table 'Post Call to Home Append' and table 'Post Call Dates Append'

 

Problem

- I need to create a new column in the 'Post to Home Append' table that will pull in the earliest or min date of 'Post Call Dates Append'[PC Date].

 

WHERE

‘Post Call to Home Append’[Member ID]  = ‘Post Call Dates Append’[Mem ID]

And ‘Post Call to Home Append’[Discharge date] <= ‘Post Call Dates Append’[PC Date]

And ‘Post Call to Home Append’[Next Admit Date] >= ‘Post Call Dates Append’[PC Date]

 

Can you please assist?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@AW1976NOVA , Try a new column like

 

minx( filter('Post Call Dates Append',
'Post Call to Home Append'[Member ID] = 'Post Call Dates Append'[Mem ID]
&& 'Post Call to Home Append'[Discharge date] <= 'Post Call Dates Append'[PC Date]
&& 'Post Call to Home Append'[Next Admit Date] >= 'Post Call Dates Append'[PC Date]),'Post Call Dates Append'[PC Date])

 

 

refer 4 ways to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@AW1976NOVA , Try a new column like

 

minx( filter('Post Call Dates Append',
'Post Call to Home Append'[Member ID] = 'Post Call Dates Append'[Mem ID]
&& 'Post Call to Home Append'[Discharge date] <= 'Post Call Dates Append'[PC Date]
&& 'Post Call to Home Append'[Next Admit Date] >= 'Post Call Dates Append'[PC Date]),'Post Call Dates Append'[PC Date])

 

 

refer 4 ways to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8

Ahh, the minx function.  Thank you!

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.