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.
Hello guys,
I am trying to connect multiple tables with IF statements and I couldnt do it. My base table is:
Val1 | Name |
1 | A |
2 | A |
3 | A |
4 | A |
5 | A |
6 | A |
1 | B |
2 | B |
3 | B |
4 | B |
5 | B |
6 | B |
7 | B |
8 | B |
1 | C |
2 | C |
3 | C |
4 | C |
5 | C |
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.
Val2 | Val3 | Name | Price |
2 | 4 | A | 300 |
3 | 6 | B | 400 |
2 | 3 | C | 500 |
5 | 6 | A | 600 |
Basic table:
Name | Price |
A | 777 |
B | 888 |
C | 999 |
And result would look something like this:
Val1NamePrice
1 | A | 777 |
2 | A | 300 |
3 | A | 300 |
4 | A | 300 |
5 | A | 600 |
6 | A | 600 |
1 | B | 888 |
2 | B | 888 |
3 | B | 400 |
4 | B | 400 |
5 | B | 400 |
6 | B | 400 |
7 | B | 888 |
8 | B | 888 |
1 | C | 999 |
2 | C | 500 |
3 | C | 500 |
4 | C | 999 |
5 | C | 999 |
Hope someone can help me. Thank you in advance.
Solved! Go to Solution.
@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)
@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)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
83 | |
70 | |
60 |
User | Count |
---|---|
150 | |
115 | |
104 | |
89 | |
65 |