This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hi,
I'm attempting to write a nested if an statement that references 2 tables. The statement should state IF(isblank[table1criteria1]),[table1criteria2],if([table1criteria2] date is between [table2criteria] then return [table2criteria2]) otherwise if false return "Non-Reservation"
Essentially I want the formula to return a criteria based on a value in table 1 being between 2 dates in a value in table 2. It'd return a value from table 2.
It won't let me reference 2 different tables. Is there another solution?
Solved! Go to Solution.
Hi @Anonymous ,
Can you provide some sample data and expected results?
From what I understand, your two tables look like
You could create a calculated table to judge
Table =
ADDCOLUMNS (
CROSSJOIN ( 'table1', 'table2' ),
"Column",
IF (
[criteria1] = BLANK (),
[criteria2],
IF (
[date] < [date2]
&& [date] > [date1],
[table2criteria2],
"Non-Reservation"
)
)
)
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Can you provide some sample data and expected results?
From what I understand, your two tables look like
You could create a calculated table to judge
Table =
ADDCOLUMNS (
CROSSJOIN ( 'table1', 'table2' ),
"Column",
IF (
[criteria1] = BLANK (),
[criteria2],
IF (
[date] < [date2]
&& [date] > [date1],
[table2criteria2],
"Non-Reservation"
)
)
)
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , Assume you need a new column
new column =
var _cnt = maxx(filter(Table2, Table1[Date] >= Table2[Date1] && Table1[Date1] <= Table2[Date2] ) ,Table2[table2criteria2] )
return
IF(isblank[table1criteria1]),[table1criteria2] , if(not(Isbalnk(_cnt)) , _cnt , "Non-Reservation" ) )
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 31 | |
| 25 | |
| 21 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 65 | |
| 41 | |
| 28 | |
| 22 | |
| 22 |