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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Connecting tables with IF statements

Hello guys,

 

I am trying to connect multiple tables with IF statements and I couldnt do it. My base table is:

Val1Name
1A
2A
3A
4A
5A
6A
1B
2B
3B
4B
5B
6B
7B
8B
1C
2C
3C
4C
5C

To this base table I want to add prices and IF Val1 is equal or between Val2 and Val3 add price from table below else add price from basic table.

Val2Val3NamePrice
24A300
36B400
23C500
56A600

 

Basic table:

NamePrice
A777
B888
C999

 

And result would look something like this:

Val1NamePrice

1A777
2A300
3A300
4A300
5A600
6A600
1B888
2B888
3B400
4B400
5B400
6B400
7B888
8B888
1C999
2C500
3C500
4C999
5C999

 

Hope someone can help me. Thank you in advance.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Matjaz , Create a new column

nueva columna ?
var _1 á maxx(filter(Table2, Table1[val] >- table2[Val2] && Table1[Val1] <-Table2[Val3] && Table1[name] à table2[name]), [price])
var _2 á maxx(filter(Table3, Table1[name] á table3[name]), [price])
devolución
if(blank(_1), _2, _1)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Matjaz , Create a new column

nueva columna ?
var _1 á maxx(filter(Table2, Table1[val] >- table2[Val2] && Table1[Val1] <-Table2[Val3] && Table1[name] à table2[name]), [price])
var _2 á maxx(filter(Table3, Table1[name] á table3[name]), [price])
devolución
if(blank(_1), _2, _1)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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!

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.

Top Solution Authors