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
RichHead1821
Resolver I
Resolver I

Retrieve a date from another table where criteria is met

Hi,

 

I have two tables:

T1 holds:  interviewID, status, statusvalue & statusdate

T2 holds: interviewID, lots of other columns and a new column created by DAX which I want to store a date when a certain status & statusvalue is found in T1.

 

T2 new column measure = 

LOOKUPVALUE('T1'[StatusDate],'T1'[interviewId],SelectedValue('T2'[interviewId]),T1[status],"Quoted",T1[statusvalue],"Complete")
 
I can see there are entries in T1 with interviewId which match entries in T2 and that T1 has lots where the status = Quoted and th statusvalue = Completed; but the DAX never returns a date (it does not error, just never seems to find the matches and return a date).
 
As I thought this was the easy part of what I'm building it has left me somewhat discombobulated.
1 ACCEPTED SOLUTION

Solution remove the 'SELECTEDVALUE' from the DAX:

 

T2 new column measure = LOOKUPVALUE('T1'[StatusDate], 'T1'[interviewId],' T2'[interviewId], T1[status],"Quoted", T1[statusvalue],"Complete")

View solution in original post

10 REPLIES 10
harshnathani
Community Champion
Community Champion

Hi @RichHead1821 ,

 

Can you share some sample date.

 

Regards,

Harsh Nathani

No, as the data is commercially sensitive.

 

The two IDs are wholenumbers, the status and statusvalue are text and the date to return and the new column are both datetime

Hi @RichHead1821 ,

 

 

Try creating some dummy values. i can try but you know how the data looks like 🙂

 

Regards,

Harsh Nathani

How do I share a PBIX file here?

Hi @harshnathani - I have an example PBIX file which demonstrates this (with dummy data) - but have no idea how to share that data

 

 

This is T1

RichHead1821_0-1596805471980.png

This is T2

RichHead1821_1-1596805519539.png

Relationships

RichHead1821_2-1596805587593.png

 

@RichHead1821 , I do see any date in T1. But any date in T1 in slicer can filter T2

I am trying to create the date in T1, using the DAX in the first screenshot...

Solution remove the 'SELECTEDVALUE' from the DAX:

 

T2 new column measure = LOOKUPVALUE('T1'[StatusDate], 'T1'[interviewId],' T2'[interviewId], T1[status],"Quoted", T1[statusvalue],"Complete")

Hi @RichHead1821 ,

 

Try One Drive or Google Drive.

 

Regards,

HN

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.

Top Solution Authors