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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Check if a value exists in a table given several conditions and given there's no table relationship

Hello,

 

I have three tables (A, B and C) and due to none unique values in the three tables, no relationship has been created in between these tables. Given certain conditions, I have to check if there exists a value in table B which is equal to a value in table C (and return Yes or No in table A depending on the result). In details:

 

Conditions:

 

  1. Type (Table A) = "To be verified"
  2. Start date (Table A) >= End date (Table C) or Start date (Table A) <= End date (Table C)
  3. Name of employee (Table B) = Name of employee (Table C)
  4. ID (Table A) = ID (Table B)

 

If the above conditions are met, return Yes else return No.

 

Thank you

 

 

 

10 REPLIES 10
Anonymous
Not applicable

Hello @Anonymous @harshnathani 

 

Indeed I should have shown some data. To make it simple, I have reduced to two tables : A and B. Furthermore, I have written, at the end, the "logic" I want to apply.

 

Table A shows proposals received by a company for different temporary jobs. Each job has its own reference.

 

Table A

 

CandidateReference 1.0Start dateRecruiterTitle of the job
GZ65-128/02/2020ArthurBI analyst
BX14-101/03/2020JamesDev JAVA
WZ65-128/02/2020ArthurBI analyst

 

 

Table B shows information regarding past temporary jobs, for example: the start and end date, the job's reference and the person employed.

 

Reference 2.0Start dateEnd dateTitle of the jobEmployee
A47-101/01/202028/02/2020Dev JAVAB
D69-101/10/201931/04/2020BI analystD

 

B had a contract which ended on the 28th of February and make a proposal for another contract for the same job starting on the 1st of March. In other words, here we are talking about contract renewals. Depending on certain conditions, I want to be able to say that an employee's contract has been renewed for a job or not.

 

Conditions to be met in order to tell if the contract is new or concerns a renewal:

 

1) The start date of the job must be maximum 60 days after the end date of the previous contract

2) Candidate = Employee

3) Title of the job (table A) = Title of the job (table B)

 

For information :

 

1) Reference 1.0 is not the same as reference 2.0

2) The date condition is really important

3) No relationship has been able to be created between these two tables that no unique values exist.

 

 

 
 
Anonymous
Not applicable

That's of course doable in DAX... but it's really a job that should be performed in Power Query. Why don't you do it in PQ then?

Best
D
Anonymous
Not applicable

Hello @Anonymous,

 

Thank you for your answer. I'm not really familiar with M/Power Query and I think that there may be some limitations using Power Query instead of DAX for lookup or maybe I'm wrong.

 

I think that something like this would have worked if there were relationships between the tables :

 

Condition = IF(

'Table A'[Candidate]= RELATED('Table B';'Table B'[Employee]) &&

LEFT('Table A'[Title of the job];15) = LEFT(RELATED('Table B';'Table B'[Title of the job]);15) &&
 
'Table A'[Start Date].[Date] >= RELATED(' Table B';'Table B'[End Date].[Date]) - 60);

"Possible prolongation";
"Nouveau AO")
Anonymous
Not applicable

In fact, the opposite is true - Power Query is more powerful than DAX with respect to data mashup (and data mashup is what you ask for).

If you give me some good sample sets (text form), I'll create the M script for you. M is the language that Power Query uses.

Best
D
Anonymous
Not applicable

Hello @Anonymous, the sample given above isn't enough ? 

 

Thank you

Anonymous
Not applicable

The sample you've given above is a bit small and I don't think it covers most of the issues you could encounter in sets like these. Please supply some representative samples.

Thanks.

Best
D
harshnathani
Community Champion
Community Champion

@Anonymous ,

 

Can you pls share some sample Data in text format.

 

Regards,

HN

Greg_Deckler
Community Champion
Community Champion

@Anonymous You need to use LOOKUPVALUE or MAXX(FILTER(...),...)

 

If this is not specific enough, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Unfortunately, your answer doesn't help...
Anonymous
Not applicable

@Anonymous, you have to show us sample data and what you want to do. Your initial description is not clear enough, unfortunately.

Best
D

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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