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
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)

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)

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.