cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

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
Super User IV
Super User IV

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



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

1 REPLY 1
Super User IV
Super User IV

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



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Helpful resources

Announcements
secondImage

Happy New Year from Power BI

This is a must watch for a message from Power BI!

December Update

Check it Out!

Click here to read more about the December 2020 Updates!

Community Blog

Check it Out!

Click here to read the latest blog and learn more about contributing to the Power BI blog!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors