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
LogiFons
Frequent Visitor

If and And statement from 2 tables with different conditions

Hello all,

 

I am pretty new and can not find my solution in the other posts.

Can you please help me?

 

I will try to explain (probably harder then the solution 🙂 )

 

I have 2 tables:

 

Table A  
NumberDescriptionSeason 1
1Jacketsummer
2Jacketspring
3Trouserspring
4Hatsummer

 

Table B  
OrderDescriptionSeason
1Jacket 
2Jacket 
3Trouser 
4Hat 

 

When:

 

[Number] from Table A = [Order] from table B

AND

[Description] from Table A = [Description] from table B

 

 

Then column "Season" from table B must be filled in by column "Season 1", table A.

 

The "Numbers" and  "Orders" are unique and have the relation many-to-one.

 

Has anyone an idea?

 

Thank you!

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION
v-xinruzhu-msft
Community Support
Community Support

Hi @LogiFons 

You can refer to the following calculated column

Season = MAXX(FILTER('Table A',[Number]=EARLIER('Table B'[Order])&&[Description]=EARLIER('Table B'[Description])),[Season 1])

vxinruzhumsft_0-1679535464622.png

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
v-xinruzhu-msft
Community Support
Community Support

Hi @LogiFons 

You can refer to the following calculated column

Season = MAXX(FILTER('Table A',[Number]=EARLIER('Table B'[Order])&&[Description]=EARLIER('Table B'[Description])),[Season 1])

vxinruzhumsft_0-1679535464622.png

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

LogiFons
Frequent Visitor

Hello,

 

Sorry, i am mistaking.

In Table A, the column Number is not always unique.

In Table B, the column Order is unique.

 

Table A  
NumberDescriptionSeason 1
1Jacketsummer
2Jacketspring
3Trouserspring
4Hatsummer

 

Table B  
OrderDescriptionSeason
1Jacket 
2Jacket 
3Trouser 
4Hat 

 

 

Gr,

 

 

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.